Skip to content

Commit

Permalink
check argc before using argv[1]
Browse files Browse the repository at this point in the history
  • Loading branch information
sertonix authored and annacrombie committed Jul 25, 2024
1 parent baad664 commit 834460d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ main(int argc, char *argv[])
{
SBUF(basename);
path_basename(NULL, &basename, argv[0]);
meson_compat = strcmp(basename.buf, "meson") == 0 && strcmp(argv[1], "internal") != 0;
meson_compat = strcmp(basename.buf, "meson") == 0 && (argc < 2 || strcmp(argv[1], "internal") != 0);
sbuf_destroy(&basename);
}

Expand Down

0 comments on commit 834460d

Please sign in to comment.