mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-04-13 23:36:10 +02: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:
@@ -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