mirror of
https://github.com/curl/curl.git
synced 2026-07-23 22:57:17 +03:00
mqtt: fix EOF handling
In mqtt_recv_atleast(), recognize an EOF as error. Fixes #20815 Reported-by: Max Dymond Closes #20830
This commit is contained in:
parent
5f13a7645e
commit
704e7a85f3
1 changed files with 2 additions and 0 deletions
|
|
@ -379,6 +379,8 @@ static CURLcode mqtt_recv_atleast(struct Curl_easy *data, size_t nbytes)
|
|||
result = Curl_xfer_recv(data, (char *)readbuf, nbytes - rlen, &nread);
|
||||
if(result)
|
||||
return result;
|
||||
if(!nread) /* EOF */
|
||||
return CURLE_RECV_ERROR;
|
||||
if(curlx_dyn_addn(&mq->recvbuf, readbuf, nread))
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
rlen = curlx_dyn_len(&mq->recvbuf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue