mirror of
https://github.com/curl/curl.git
synced 2026-07-16 08:07:17 +03:00
curl_ws_recv: return recv 0 and point meta to NULL on all errors
Previously it could accidentally return some errors without having reset the values. Closes #15342
This commit is contained in:
parent
2816cba2d7
commit
d6bae1cb8f
1 changed files with 3 additions and 2 deletions
5
lib/ws.c
5
lib/ws.c
|
|
@ -933,6 +933,9 @@ CURL_EXTERN CURLcode curl_ws_recv(CURL *d, void *buffer,
|
|||
struct websocket *ws;
|
||||
struct ws_collect ctx;
|
||||
|
||||
*nread = 0;
|
||||
*metap = NULL;
|
||||
|
||||
if(!conn) {
|
||||
/* Unhappy hack with lifetimes of transfers and connection */
|
||||
if(!data->set.connect_only) {
|
||||
|
|
@ -952,8 +955,6 @@ CURL_EXTERN CURLcode curl_ws_recv(CURL *d, void *buffer,
|
|||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
}
|
||||
|
||||
*nread = 0;
|
||||
*metap = NULL;
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
ctx.data = data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue