From 80b6cd92af1891d9645923db3bbd453c99e99d45 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 17 Mar 2026 16:22:54 +0100 Subject: [PATCH] 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 f847d2ed0244319ee6b5e9b054c Found by Codex Security Closes #20963 --- src/tool_formparse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tool_formparse.c b/src/tool_formparse.c index 3760419fd9..0845e0c0f5 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -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; }