mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-07-29 18:28:24 +02:00
FIX: mqtt_get_id wrong logic on msg size checks.
This error was preventing the function from returning the right msg ID, returning always 0.
This commit is contained in:
committed by
David Cermak
parent
d159bf4575
commit
db71c753aa
@ -307,13 +307,13 @@ uint16_t mqtt_get_id(uint8_t* buffer, uint16_t length)
|
||||
topiclen = buffer[i++] << 8;
|
||||
topiclen |= buffer[i++];
|
||||
|
||||
if (i + topiclen >= length)
|
||||
if (i + topiclen > length)
|
||||
return 0;
|
||||
i += topiclen;
|
||||
|
||||
if (mqtt_get_qos(buffer) > 0)
|
||||
{
|
||||
if (i + 2 >= length)
|
||||
if (i + 2 > length)
|
||||
return 0;
|
||||
//i += 2;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user