git: 3a504205e430 - releng/12.3 - cmp: initialize limit to avoid stack garbage limits

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Tue, 26 Oct 2021 07:50:42 UTC
The branch releng/12.3 has been updated by kevans:

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

commit 3a504205e4301be9378d17282a571f311272c6fb
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2021-10-21 16:30:55 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-10-26 07:47:17 +0000

    cmp: initialize limit to avoid stack garbage limits
    
    Approved by:    re (gjb)
    Pointy hat:     kevans
    Fixes:  4e380e847460 ("cmp: add -n, --bytes to limit number of bytes [...]")
    Sponsored by:   Klara, Inc.
    
    (cherry picked from commit f1f7f31366e5830f4f5b96c6394a0b91475744f4)
    (cherry picked from commit aba2dc46dfa51cf9e1b1987ca4e91f703ae7e368)
---
 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) {