mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-14 10:20:01 +00:00
Fix fuzzer use-after-poison READ 1
This commit is contained in:
1 parent
cab5c822c5
commit
a39b7ddbac
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user