If a CIE doesn't fit in the remainder of the mandatory part, return the
length of that remainder, so that the loop processing the CIE
terminates.
Add capture that produced the infinite loop.
invalid:
nd_print_invalid(ndo);
+
+ /*
+ * We get here because this CIE goes past thE remaining length,
+ * of the mandatory part. We've reported that error; we now
+ * assignt he insufficnetly-large remaining piece of the
+ * mandatory part to this CIE, so that this CIE finishes up
+ * the mandatory part, and the loop processing the CIEs
+ * terminates. There cannot be any CIEs after this one.
+ */
+ cie_len += mand_part_len;
return (cie_len);
}
NHRP-responder-address NHRP-responder-address.pcap NHRP-responder-address.out -v
nhrp-trace nhrp-trace.pcap nhrp-trace.out -v
nhrp nhrp.pcap nhrp.out -v
+pb_nhrp_1 pb_nhrp_1.pcap pb_nhrp_1.out -v
# Undefined behavior tests
ip-snmp-leftshift-unsigned ip-snmp-leftshift-unsigned.pcap ip-snmp-leftshift-unsigned.out
--- /dev/null
+ 1 13:37:05.16842874 IP (tos 0xc, id 0, offset 0, flags [rsvd], proto unknown (54), length 64, options (unknown 107 [bad length 37]), bad cksum 101 (->41a4)!)
+ 62.41.66.144 > 191.215.63.14: NHRP: res request, id 0, hopcnt 103, unknown-nbma-addr-family-5dc9 (01), proto type 007b 67 -> 49 [remaining mandatory part length 8 < 12] (invalid)