The error was:
print-ldp.c:557:13: runtime error: unsigned integer overflow: 32 - 34
cannot be represented in type 'unsigned int'
-static int ldp_pdu_print(netdissect_options *, const u_char *);
+static u_int ldp_pdu_print(netdissect_options *, const u_char *);
ldp_print(netdissect_options *ndo,
const u_char *pptr, u_int len)
{
ldp_print(netdissect_options *ndo,
const u_char *pptr, u_int len)
{
ndo->ndo_protocol = "ldp";
while (len > (sizeof(struct ldp_common_header) + sizeof(struct ldp_msg_header))) {
processed = ldp_pdu_print(ndo, pptr);
if (processed == 0)
return;
ndo->ndo_protocol = "ldp";
while (len > (sizeof(struct ldp_common_header) + sizeof(struct ldp_msg_header))) {
processed = ldp_pdu_print(ndo, pptr);
if (processed == 0)
return;
+ if (len < processed) {
+ ND_PRINT(" [remaining length %u < %u]", len, processed);
+ nd_print_invalid(ndo);
+ break;
+ }
len -= processed;
pptr += processed;
}
}
len -= processed;
pptr += processed;
}
}
ldp_pdu_print(netdissect_options *ndo,
const u_char *pptr)
{
ldp_pdu_print(netdissect_options *ndo,
const u_char *pptr)
{