Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Oct 2021 19:02:19 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b6aec7884750 - stable/13 - cmp: initialize limit to avoid stack garbage limits
Message-ID:  <202110231902.19NJ2JH0075435@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=b6aec78847501c4f7a79552651991e0842ecaec3

commit b6aec78847501c4f7a79552651991e0842ecaec3
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2021-10-21 16:30:55 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-10-23 19:01:00 +0000

    cmp: initialize limit to avoid stack garbage limits
    
    Pointy hat:     kevans
    Fixes:  4e380e847460 ("cmp: add -n, --bytes to limit number of bytes [...]")
    Sponsored by:   Klara, Inc.
    
    (cherry picked from commit f1f7f31366e5830f4f5b96c6394a0b91475744f4)
---
 usr.bin/cmp/cmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c
index 98ae96c73375..83ea7ae7eee0 100644
--- a/usr.bin/cmp/cmp.c
+++ b/usr.bin/cmp/cmp.c
@@ -105,7 +105,7 @@ main(int argc, char *argv[])
 	bool special;
 	const char *file1, *file2;
 
-	skip1 = skip2 = 0;
+	limit = skip1 = skip2 = 0;
 	oflag = O_RDONLY;
 	while ((ch = getopt_long(argc, argv, "+bhi:ln:sxz", long_opts, NULL)) != -1)
 		switch (ch) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110231902.19NJ2JH0075435>