mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-14 09:48:01 +08:00
Fix fuzzer use-after-poison READ 1
This commit is contained in:
parent
cab5c822c5
commit
a39b7ddbac
@ -3196,7 +3196,7 @@ int mg_mqtt_parse(const uint8_t *buf, size_t len, uint8_t version,
|
||||
p += 2;
|
||||
}
|
||||
if (p > end) return MQTT_MALFORMED;
|
||||
if (version == 5 && p + 1 < end) p += 1 + p[0]; // Skip options
|
||||
if (version == 5 && p + 2 < end) p += 1 + p[0]; // Skip options
|
||||
if (p > end) return MQTT_MALFORMED;
|
||||
m->data.ptr = (char *) p;
|
||||
m->data.len = (size_t) (end - p);
|
||||
|
@ -173,7 +173,7 @@ int mg_mqtt_parse(const uint8_t *buf, size_t len, uint8_t version,
|
||||
p += 2;
|
||||
}
|
||||
if (p > end) return MQTT_MALFORMED;
|
||||
if (version == 5 && p + 1 < end) p += 1 + p[0]; // Skip options
|
||||
if (version == 5 && p + 2 < end) p += 1 + p[0]; // Skip options
|
||||
if (p > end) return MQTT_MALFORMED;
|
||||
m->data.ptr = (char *) p;
|
||||
m->data.len = (size_t) (end - p);
|
||||
|
Loading…
x
Reference in New Issue
Block a user