mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 04:58:57 +00: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
1 changed files with 6 additions and 0 deletions
|
@ -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 a new issue