From: Viktor Szakats Date: Mon, 22 Jun 2026 09:34:10 +0000 (+0200) Subject: setopt: return error if received `curl_blob->data` is NULL X-Git-Tag: curl-8_21_0~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f7d4e11f4b423a6db61ca86cf59483fad9f4bc13;p=thirdparty%2Fcurl.git setopt: return error if received `curl_blob->data` is NULL To avoid dereferencing in the function if `CURL_BLOB_COPY` is set, or outside of the function if unset. Reported-by: netspacer.research Closes #22129 --- diff --git a/lib/setopt.c b/lib/setopt.c index df054469d4..eb9ff2e396 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -108,7 +108,7 @@ CURLcode Curl_setblobopt(struct curl_blob **blobp, if(blob) { struct curl_blob *nblob; - if(!blob->len || (blob->len > CURL_MAX_INPUT_LENGTH)) + if(!blob->data || !blob->len || (blob->len > CURL_MAX_INPUT_LENGTH)) return CURLE_BAD_FUNCTION_ARGUMENT; nblob = (struct curl_blob *) curlx_malloc(sizeof(struct curl_blob) +