Fixes a heap overflow found with American Fuzzy Lop by Hanno Böck.
length -= SLIP_HDRLEN;
ip = (const struct ip *)(p + SLIP_HDRLEN);
length -= SLIP_HDRLEN;
ip = (const struct ip *)(p + SLIP_HDRLEN);
if (ndo->ndo_eflag)
sliplink_print(ndo, p, ip, length);
if (ndo->ndo_eflag)
sliplink_print(ndo, p, ip, length);
+ if (caplen < 1 || length < 1) {
+ ND_PRINT((ndo, "%s", tstr));
+ return (caplen + SLIP_HDRLEN);
+ }
+
switch (IP_V(ip)) {
case 4:
ip_print(ndo, (const u_char *)ip, length);
switch (IP_V(ip)) {
case 4:
ip_print(ndo, (const u_char *)ip, length);
heapoverflow-atalk_print heapoverflow-atalk_print.pcap heapoverflow-atalk_print.out -t -v -n
heapoverflow-EXTRACT_16BITS heapoverflow-EXTRACT_16BITS.pcap heapoverflow-EXTRACT_16BITS.out -t -v -n
heapoverflow-ppp_hdlc_if_print heapoverflow-ppp_hdlc_if_print.pcap heapoverflow-ppp_hdlc_if_print.out -t -v -n
heapoverflow-atalk_print heapoverflow-atalk_print.pcap heapoverflow-atalk_print.out -t -v -n
heapoverflow-EXTRACT_16BITS heapoverflow-EXTRACT_16BITS.pcap heapoverflow-EXTRACT_16BITS.out -t -v -n
heapoverflow-ppp_hdlc_if_print heapoverflow-ppp_hdlc_if_print.pcap heapoverflow-ppp_hdlc_if_print.out -t -v -n
+heapoverflow-sl_if_print heapoverflow-sl_if_print.pcap heapoverflow-sl_if_print.out -t -v -n