]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: fix OOM exit in Curl_http_follow
authorDaniel Stenberg <daniel@haxx.se>
Wed, 26 Nov 2025 10:01:09 +0000 (11:01 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 26 Nov 2025 10:57:09 +0000 (11:57 +0100)
Spotted by "strict torture" tests.

Closes #19705

lib/http.c

index ae932cd7c93a565753db005209ca700cd6215ac7..144a898ea0ebdc97ca683a6a6934f82f58b2685d 100644 (file)
@@ -1282,7 +1282,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl,
                      CURLU_ALLOW_SPACE |
                      (data->set.path_as_is ? CURLU_PATH_AS_IS : 0)));
   if(uc) {
-    if(type != FOLLOW_FAKE) {
+    if((uc == CURLUE_OUT_OF_MEMORY) || (type != FOLLOW_FAKE)) {
       failf(data, "The redirect target URL could not be parsed: %s",
             curl_url_strerror(uc));
       return Curl_uc_to_curlcode(uc);