mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 14:29:39 +00:00
test/fuzz: Don't crash with assertion failure when a packet is too big
A fuzzer may generate big packets, and it will interpret assertion failures as bugs. Instead of asserting that the packet size is reasonable, simply skip the packet when it's not the case.
This commit is contained in:
parent
0f2de1f684
commit
e8b0324f81
@ -192,7 +192,11 @@ static void input_pkt(struct netif *netif, const u8_t *data, size_t len)
|
||||
struct pbuf *p, *q;
|
||||
err_t err;
|
||||
|
||||
LWIP_ASSERT("pkt too big", len <= 0xFFFF);
|
||||
if (len > 0xFFFF) {
|
||||
printf("pkt too big (%#zX bytes)\n", len);
|
||||
return;
|
||||
}
|
||||
|
||||
p = pbuf_alloc(PBUF_RAW, (u16_t)len, PBUF_POOL);
|
||||
LWIP_ASSERT("alloc failed", p);
|
||||
for(q = p; q != NULL; q = q->next) {
|
||||
|
Loading…
Reference in New Issue
Block a user