mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-27 12:26:24 +00:00
validate props, fuzz them
This commit is contained in:
1 parent
70d268d95f
commit
2d7e8aa712
3 files changed
+38
-6
No files matched your search
@@ -62,6 +62,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
mg_crc32(0, mm.topic.buf, mm.topic.len);
|
||||
mg_crc32(0, mm.data.buf, mm.data.len);
|
||||
mg_crc32(0, mm.dgram.buf, mm.dgram.len);
|
||||
{
|
||||
struct mg_mqtt_prop prop;
|
||||
size_t ofs = 0;
|
||||
while ((ofs = mg_mqtt_next_prop(&mm, &prop, ofs)) > 0) {
|
||||
mg_crc32(0, prop.key.buf, prop.key.len);
|
||||
mg_crc32(0, prop.val.buf, prop.val.len);
|
||||
}
|
||||
}
|
||||
}
|
||||
mg_mqtt_parse(NULL, 0, 5, &mm);
|
||||
|
||||
|
||||
Reference in new issue
Block a user