]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix argv overrun in getconf (bug 27761)
authorAndreas Schwab <schwab@linux-m68k.org>
Wed, 21 Apr 2021 12:27:21 +0000 (14:27 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Wed, 21 Apr 2021 13:11:26 +0000 (15:11 +0200)
Correct argument counter accounting when processing the -v option with the
argument directly attached.

posix/getconf.c

index efc9623b3bb0db6514e1d2321107356dc6df40e0..4dccc9cbf2a530a1ef6f7c1d29fdf07dc8920ff5 100644 (file)
@@ -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