mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 18:03:37 +08:00
Fixes use-after-free issue.
Calling writer() might fail in which case launch_buff gets freed. This patch prevents the subsequent use of memory after it was freed.
This commit is contained in:
parent
18c1b12741
commit
706286c289
|
@ -1190,6 +1190,12 @@ static void launch(char *filter, const string_list_t &files, size_t fileno)
|
|||
writer('&');
|
||||
writer('\0');
|
||||
|
||||
/*
|
||||
Calling writer might fail in which case launch_buff gets freed.
|
||||
*/
|
||||
if (error)
|
||||
return;
|
||||
|
||||
if (system(launch_buff) == -1)
|
||||
{
|
||||
fprintf(stderr, _(ERROR_SYSTEM), MIMEDB, launch_buff);
|
||||
|
|
Loading…
Reference in New Issue
Block a user