mirror of
https://github.com/curl/curl.git
synced 2026-08-02 08:20:29 +03:00
ws: avoid NULL pointer deref in curl_ws_recv
If a NULL easy handle is passed in.
Pointed out by Coverity
Follow-up to 960fb49245
Closes #18065
This commit is contained in:
parent
f7af8adadd
commit
9d2075bdce
1 changed files with 2 additions and 1 deletions
3
lib/ws.c
3
lib/ws.c
|
|
@ -1150,7 +1150,7 @@ CURLcode curl_ws_recv(CURL *d, void *buffer,
|
|||
const struct curl_ws_frame **metap)
|
||||
{
|
||||
struct Curl_easy *data = d;
|
||||
struct connectdata *conn = data->conn;
|
||||
struct connectdata *conn;
|
||||
struct websocket *ws;
|
||||
struct ws_collect ctx;
|
||||
|
||||
|
|
@ -1159,6 +1159,7 @@ CURLcode curl_ws_recv(CURL *d, void *buffer,
|
|||
if(!GOOD_EASY_HANDLE(data))
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
|
||||
conn = data->conn;
|
||||
if(!conn) {
|
||||
/* Unhappy hack with lifetimes of transfers and connection */
|
||||
if(!data->set.connect_only) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue