ws: reject curl_ws_recv called with NULL buffer with a buflen

Arguably this is just a bad application.

Reported in Joshua's sarif data

Closes #18656
This commit is contained in:
Daniel Stenberg 2025-09-21 10:18:13 +02:00
parent 0c53a5e5dc
commit d57e7cf20d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -1502,7 +1502,7 @@ CURLcode curl_ws_recv(CURL *d, void *buffer,
*nread = 0;
*metap = NULL;
if(!GOOD_EASY_HANDLE(data))
if(!GOOD_EASY_HANDLE(data) || (buflen && !buffer))
return CURLE_BAD_FUNCTION_ARGUMENT;
conn = data->conn;