Fixes a heap overflow found with American Fuzzy Lop by Hanno Böck.
if (datalen)
ND_PRINT((ndo, " 0x"));
for (i = 0; i < datalen; ++i) {
- LENCHECK(i);
+ LENCHECK(i + 1);
ND_PRINT((ndo, "%02x", cp[i]));
}
break;
heapoverflow-sl_if_print heapoverflow-sl_if_print.pcap heapoverflow-sl_if_print.out -t -v -n
heapoverflow-ip_print_demux heapoverflow-ip_print_demux.pcap heapoverflow-ip_print_demux.out -t -v -n
heapoverflow-in_checksum heapoverflow-in_checksum.pcap heapoverflow-in_checksum.out -t -v -n
+heapoverflow-tcp_print heapoverflow-tcp_print.pcap heapoverflow-tcp_print.out -t -v -n
--- /dev/null
+IP (tos 0x30, ttl 48, id 12336, offset 0, flags [DF], proto TCP (6), length 12336, bad cksum 3030 (->29a8)!)
+ 48.48.48.48.12336 > 48.48.48.48.12336: Flags [.U], seq 808464432:808476688, ack 808464432, win 12336, urg 12336, options [unknown-48 0x3030303030303030[|tcp]