]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib: error for OOM when extracting URL query
authorDaniel Stenberg <daniel@haxx.se>
Tue, 18 Nov 2025 16:01:30 +0000 (17:01 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 18 Nov 2025 22:42:24 +0000 (23:42 +0100)
Closes #19594

lib/imap.c
lib/url.c

index d23076a48f8594b620384b9286a6ed8b317ea376..faa595561dfa9edd0e910201c2c34f80e89434aa 100644 (file)
@@ -2315,8 +2315,10 @@ static CURLcode imap_parse_url_path(struct Curl_easy *data,
      and no UID as per RFC-5092 */
   if(imap->mailbox && !imap->uid && !imap->mindex) {
     /* Get the query parameter, URL decoded */
-    (void)curl_url_get(data->state.uh, CURLUPART_QUERY, &imap->query,
-                       CURLU_URLDECODE);
+    CURLUcode uc = curl_url_get(data->state.uh, CURLUPART_QUERY, &imap->query,
+                                CURLU_URLDECODE);
+    if(uc == CURLUE_OUT_OF_MEMORY)
+      return CURLE_OUT_OF_MEMORY;
   }
 
   /* Any extra stuff at the end of the URL is an error */
index 527d69839049e13fe6d62f122ad1c9d68415633a..b4069e30f18bfc32ef4f841865a46109841af29c 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1974,7 +1974,9 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
       conn->remote_port = (unsigned short)port;
   }
 
-  (void)curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query, 0);
+  uc = curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query, 0);
+  if(uc && (uc != CURLUE_NO_QUERY))
+    return CURLE_OUT_OF_MEMORY;
 
 #ifdef USE_IPV6
   if(data->set.scope_id)