Skip to content

Commit

Permalink
Fixed typo in exec_ptrace.c
Browse files Browse the repository at this point in the history
  • Loading branch information
arjenlentz authored and millert committed Sep 4, 2024
1 parent 3e12cac commit f47c880
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/exec_ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,7 @@ script_matches(const char *script, const char *execpath, int argc,
/* Match interpreter. */
if (!pathname_matches(execpath, interp, true)) {
/* It is possible for the interpreter to be a script too. */
if (argv > 0 && strcmp(interp, argv[1]) == 0) {
if (argc > 0 && strcmp(interp, argv[1]) == 0) {
/* Interpreter args must match for *this* interpreter. */
if (interp_args == NULL ||
(argc > 1 && strcmp(interp_args, argv[2]) == 0)) {
Expand Down

3 comments on commit f47c880

@strokegmd
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why

@millert
Copy link
Collaborator

@millert millert commented on f47c880 Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@strokegmd The intent of the check is to avoid a potential out-of-bounds array access when argc is 0.

@strokegmd
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@millert che blya

Please sign in to comment.