aboutsummaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2021-04-21 14:27:21 +0200
committerAndreas Schwab <schwab@linux-m68k.org>2021-04-21 15:11:26 +0200
commitb59c6989814f7ac966ee702789b34f32a1439aaf (patch)
tree92222a0d7f1ddac1d05ff13528f9561a8c9ee55f /posix
parenta64afc225240b2b27129ccfb0516d7c958b98040 (diff)
downloadglibc-b59c6989814f7ac966ee702789b34f32a1439aaf.tar
glibc-b59c6989814f7ac966ee702789b34f32a1439aaf.tar.gz
glibc-b59c6989814f7ac966ee702789b34f32a1439aaf.tar.bz2
glibc-b59c6989814f7ac966ee702789b34f32a1439aaf.zip
Fix argv overrun in getconf (bug 27761)
Correct argument counter accounting when processing the -v option with the argument directly attached.
Diffstat (limited to 'posix')
-rw-r--r--posix/getconf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/posix/getconf.c b/posix/getconf.c
index efc9623b3b..4dccc9cbf2 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