1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

mqtt: fix Curl_read() error handling while reading remaining length

Detected by Coverity. CID 1462320.

Closes #5274
This commit is contained in:
Daniel Stenberg 2020-04-20 17:03:18 +02:00
parent fa7daafdbc
commit 96c149685b
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -569,6 +569,8 @@ static CURLcode mqtt_doing(struct connectdata *conn, bool *done)
Curl_debug(data, CURLINFO_HEADER_IN, (char *)&byte, 1);
pkt[mq->npacket++] = byte;
} while((byte & 0x80) && (mq->npacket < 4));
if(result)
break;
mq->remaining_length = mqtt_decode_len(&pkt[0], mq->npacket, NULL);
mq->npacket = 0;
if(mq->remaining_length) {