Skip to content

Commit

Permalink
fix: The loop condition should be 'i < argc' to avoid accessing argv …
Browse files Browse the repository at this point in the history
…out of bounds.

The loop condition should be 'i < argc' to avoid accessing argv out of bounds.
  • Loading branch information
RealHurrison authored Apr 28, 2024
1 parent 5b5bd68 commit d5f7bb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/FSE/programs/commandline.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int main(int argc, const char** argv)
DISPLAY(WELCOME_MESSAGE);
if (argc<2) badusage(programName);

for(i = 1; i <= argc; i++) {
for(i = 1; i < argc; i++) {
const char* argument = argv[i];

if(!argument) continue; /* Protection if argument empty */
Expand Down

0 comments on commit d5f7bb8

Please sign in to comment.