From: Daniel Stenberg Date: Tue, 18 Nov 2025 14:00:50 +0000 (+0100) Subject: cookie: return error on OOM X-Git-Tag: rc-8_18_0-1~241 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80005b4c8a5743aa48f6164f5da602cd8416451d;p=thirdparty%2Fcurl.git cookie: return error on OOM Follow-up to 3f0629ca443825916cbc0795bcd5f241fbf710 Closes #19591 --- diff --git a/lib/cookie.c b/lib/cookie.c index c7dedc95e8..85356d563b 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -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");