cookie: return error on OOM

Follow-up to 3f0629ca44
Closes #19591
This commit is contained in:
Daniel Stenberg 2025-11-18 15:00:50 +01:00
parent 6dac2631df
commit 80005b4c8a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -464,10 +464,11 @@ parse_cookie_header(struct Curl_easy *data,
return CURLE_OK;
strstore(&co->name, curlx_str(&name), curlx_strlen(&name));
strstore(&co->value, curlx_str(&val), curlx_strlen(&val));
done = TRUE;
if(co->name)
strstore(&co->value, curlx_str(&val), curlx_strlen(&val));
if(!co->name || !co->value)
return CURLE_OK;
return CURLE_OUT_OF_MEMORY;
done = TRUE;
if(invalid_octets(co->value) || invalid_octets(co->name)) {
infof(data, "invalid octets in name/value, cookie dropped");