diff options
author | Jim Meyering <jim@meyering.net> | 2003-05-09 08:50:37 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-05-09 08:50:37 +0000 |
commit | 6476197bcb97237eda456791fca64edd1303680d (patch) | |
tree | 04ed8fffe05b9dd17015ca488ad9458bd48a7597 | |
parent | 883159c8557ef69176f8442073891c68bc465dfd (diff) | |
download | coreutils-6476197bcb97237eda456791fca64edd1303680d.tar.xz |
(main): Don't overrun array bound if argc is 0.
That would happen when invoked via: execl ("/usr/bin/sort", NULL);
-rw-r--r-- | src/sort.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sort.c b/src/sort.c index ede496026..0357c8e33 100644 --- a/src/sort.c +++ b/src/sort.c @@ -2265,7 +2265,7 @@ main (int argc, char **argv) long_options, NULL)) == -1)) { - if (optind == argc) + if (argc < optind) break; files[nfiles++] = argv[optind++]; } |