Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Maciej W. Rozycki committed Jun 20, 2014
1 parent 7fd00f9 commit 4e6d234
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2014-06-20 Maciej W. Rozycki <macro@codesourcery.com>

* stdlib/tst-qsort2.c (main): Fix off-by-one argc interpretation
error.

2014-06-20 Joseph Myers <joseph@codesourcery.com>

* sysdeps/unix/sysv/linux/kernel-features.h
Expand Down
2 changes: 1 addition & 1 deletion stdlib/tst-qsort2.c
Expand Up @@ -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
{
Expand Down

0 comments on commit 4e6d234

Please sign in to comment.