mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
tool_formparse: propagate my_get_line errors when reading headers
The read_field_headers() function would return "ok" even if the
underlying file read returned error, thus would the parent not become
aware of the problem.
Follow-up to f847d2ed02
Found by Codex Security
Closes #20963
This commit is contained in:
parent
0d7677ac72
commit
80b6cd92af
@ -464,6 +464,10 @@ static int read_field_headers(FILE *fp, struct curl_slist **pheaders)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(error && !err) {
|
||||
errorf("Failed to read field headers");
|
||||
err = -1;
|
||||
}
|
||||
curlx_dyn_free(&line);
|
||||
return err;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user