Add missing safety check

* src/system.c (sys_exec_info_script): Check if fdopen succeded.
Fix by Matteo Croce.
This commit is contained in:
Sergey Poznyakoff
2024-10-25 13:40:32 +03:00
parent 8767b1c84a
commit bd06b114d9

View File

@@ -838,6 +838,12 @@ sys_exec_info_script (const char **archive_name, int volume_number)
xclose (p[PWRITE]);
fp = fdopen (p[PREAD], "r");
if (!fp)
{
signal (SIGPIPE, saved_handler);
call_arg_error ("fdopen", info_script_option);
return -1;
}
rc = getline (&buf, &size, fp);
fclose (fp);