]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: return OOM errors from hsts properly
authorDaniel Stenberg <daniel@haxx.se>
Sun, 7 Dec 2025 11:35:42 +0000 (12:35 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 7 Dec 2025 11:54:45 +0000 (12:54 +0100)
When Curl_hsts_parse() fails with out of memory, return it to parent.

Closes #19862

lib/http.c

index ba42f19ff0f943a4c811192264c475450d453bde..ce5f5becdf0e5133874c930216f0f67d90e8cf4e 100644 (file)
@@ -3501,8 +3501,11 @@ static CURLcode http_header_s(struct Curl_easy *data,
   if(v) {
     CURLcode check =
       Curl_hsts_parse(data->hsts, conn->host.name, v);
-    if(check)
+    if(check) {
+      if(check == CURLE_OUT_OF_MEMORY)
+        return check;
       infof(data, "Illegal STS header skipped");
+    }
 #ifdef DEBUGBUILD
     else
       infof(data, "Parsed STS header fine (%zu entries)",