]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: error on OOM when creating range header
authorDaniel Stenberg <daniel@haxx.se>
Thu, 20 Nov 2025 17:06:37 +0000 (18:06 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 20 Nov 2025 21:11:03 +0000 (22:11 +0100)
Closes #19630

lib/http.c

index a470c04449dd149eab5fcdba342ebba4a20e7219..095a9127a4ee81213a7642007b0d9fc43ea5eb04 100644 (file)
@@ -2538,6 +2538,8 @@ static CURLcode http_range(struct Curl_easy *data,
       free(data->state.aptr.rangeline);
       data->state.aptr.rangeline = curl_maprintf("Range: bytes=%s\r\n",
                                                  data->state.range);
+      if(!data->state.aptr.rangeline)
+        return CURLE_OUT_OF_MEMORY;
     }
     else if((httpreq == HTTPREQ_POST || httpreq == HTTPREQ_PUT) &&
             !Curl_checkheaders(data, STRCONST("Content-Range"))) {