mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
(main): Don't overrun array bound if argc is 0.
That would happen when invoked via: execl ("/usr/bin/sort", NULL);
This commit is contained in:
1 parent
883159c855
commit
6476197bcb
1 file changed
+1
-1
+1
-1
@@ -2265,7 +2265,7 @@ main (int argc, char **argv)
|
||||
long_options, NULL))
|
||||
== -1))
|
||||
{
|
||||
if (optind == argc)
|
||||
if (argc < optind)
|
||||
break;
|
||||
files[nfiles++] = argv[optind++];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user