← Commit list

f2a1535712

Stefan Eissing
Stefan Eissing
2026-09-22
SUCCESS Duration: 428s

Subject

curl_easy_send/recv: check pointer arg

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/easy.c+10 -0
@@ -1304,8 +1304,13 @@ CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n)
CURLcode result;
if(CURL_EAPI_ENTER(&guard, curl, easy_recv, &result)) {
+ if(!n) {
+ result = CURLE_BAD_FUNCTION_ARGUMENT;
+ goto out;
+ }
result = Curl_easy_recv(curl, buffer, buflen, n);
}
+out:
CURL_EAPI_LEAVE(&guard);
return result;
}
@@ -1374,9 +1379,14 @@ CURLcode curl_easy_send(CURL *curl, const void *buffer, size_t buflen,
struct Curl_easy *data = curl;
size_t written = 0;
+ if(!n) {
+ result = CURLE_BAD_FUNCTION_ARGUMENT;
+ goto out;
+ }
result = Curl_senddata(data, buffer, buflen, &written);
*n = written;
}
+out:
CURL_EAPI_LEAVE(&guard);
return result;
}