lib: error for OOM when extracting URL query

Closes #19594
This commit is contained in:
Daniel Stenberg 2025-11-18 17:01:30 +01:00
parent 9726fc8259
commit 318cd4f2ee
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 7 additions and 3 deletions

View 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 */

View file

@ -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)