fixes for several bugs found via fuzzing: overflow in $'...' hex expansion; fix for accessing freed memory when reading input from stdin and using multiple redirections to stdin; fix for pointer aliasing problem after a syntax error while executing a command string

This commit is contained in:
Chet Ramey
2025-12-30 16:06:40 -05:00
parent 722a855459
commit 4b27601dfd
10 changed files with 235 additions and 11 deletions
+4
View File
@@ -808,6 +808,7 @@ execute_command_internal (COMMAND *command, int asynchronous, int pipe_in, int p
jump_to_top_level (ERREXIT);
}
currently_executing_command = (COMMAND *)NULL;
return (last_command_exit_value);
}
else
@@ -816,6 +817,7 @@ execute_command_internal (COMMAND *command, int asynchronous, int pipe_in, int p
run_pending_traps ();
currently_executing_command = (COMMAND *)NULL;
/* Posix 2013 2.9.3.1: "the exit status of an asynchronous list
shall be zero." */
last_command_exit_value = 0;
@@ -903,6 +905,8 @@ execute_command_internal (COMMAND *command, int asynchronous, int pipe_in, int p
jump_to_top_level (ERREXIT);
}
}
currently_executing_command = (COMMAND *)NULL;
return (last_command_exit_value);
}