From: Maciej W. Rozycki Date: Fri, 20 Jun 2014 20:29:33 +0000 (+0100) Subject: stdlib/tst-qsort2.c: Fix off-by-one argc interpretation error X-Git-Tag: upstream/2.30~7294 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e6d234712f976eee62fb2047338a501da00c4c7;p=external%2Fglibc.git stdlib/tst-qsort2.c: Fix off-by-one argc interpretation error This fixes an off-by-one argc interpretation error (argv[0] is included in the count) in stdlib/tst-qsort2.c causing a segfault if the program is called with one command-line argument only (argv[2] is NULL in that case). --- diff --git a/ChangeLog b/ChangeLog index 548821e..090714d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-06-20 Maciej W. Rozycki + + * stdlib/tst-qsort2.c (main): Fix off-by-one argc interpretation + error. + 2014-06-20 Joseph Myers * sysdeps/unix/sysv/linux/kernel-features.h diff --git a/stdlib/tst-qsort2.c b/stdlib/tst-qsort2.c index 75d4a17..10d1685 100644 --- a/stdlib/tst-qsort2.c +++ b/stdlib/tst-qsort2.c @@ -70,7 +70,7 @@ int main (int argc, char **argv) { int ret = 0; - if (argc >= 2) + if (argc >= 3) ret |= test (atoi (argv[1]), atoi (argv[2])); else {