Try harder to pass validation when fuzzing decode_reply()

This commit is contained in:
dmiller 2026-08-18 16:06:56 +00:00
parent 4f83a3bdad
commit aa9daeee92

View file

@ -1219,7 +1219,20 @@ static bool decode_reply(const u8 *ip, unsigned int len, Reply *reply) {
bool fuzz_decode_reply(const u8 *ip, unsigned int len) {
global_id = 0;
Reply reply;
return decode_reply(ip, len, &reply);
if (decode_reply(ip, len, &reply))
return true;
if (len > 24) {
global_id = ntohs(*(u16 *)(ip + 22));
if (decode_reply(ip, len, &reply))
return true;
}
if (len > 44) {
global_id = ntohs(*(u16 *)(ip + 42));
if (decode_reply(ip, len, &reply))
return true;
}
return false;
}
#endif