From: Andreas Schwab Date: Wed, 21 Apr 2021 12:27:21 +0000 (+0200) Subject: Fix argv overrun in getconf (bug 27761) X-Git-Tag: glibc-2.34~637 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b59c6989814f7ac966ee702789b34f32a1439aaf;p=thirdparty%2Fglibc.git Fix argv overrun in getconf (bug 27761) Correct argument counter accounting when processing the -v option with the argument directly attached. --- diff --git a/posix/getconf.c b/posix/getconf.c index efc9623b3bb..4dccc9cbf2a 100644 --- a/posix/getconf.c +++ b/posix/getconf.c @@ -519,7 +519,7 @@ environment SPEC.\n\n")); else { argv += 1; - argc += 1; + argc -= 1; } } #else @@ -544,7 +544,7 @@ environment SPEC.\n\n")); { spec = &argv[1][2]; argv += 1; - argc += 1; + argc -= 1; } } else