diff options
Diffstat (limited to 'example/reader_util.c')
-rw-r--r-- | example/reader_util.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/example/reader_util.c b/example/reader_util.c index eca4d12d5..8b7f55fe4 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -1607,6 +1607,9 @@ ether_type_check: iph_check: /* Check and set IP header size and total packet length */ + if (header->caplen < ip_offset + sizeof(struct ndpi_iphdr)) + return(nproto); /* Too short for next IP header*/ + iph = (struct ndpi_iphdr *) &packet[ip_offset]; /* just work on Ethernet packets that contain IP */ |