aboutsummaryrefslogtreecommitdiffstats
path: root/print-ppi.c
diff options
context:
space:
mode:
Diffstat (limited to 'print-ppi.c')
-rw-r--r--print-ppi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/print-ppi.c b/print-ppi.c
index 72cd1b867fd5..66b758215015 100644
--- a/print-ppi.c
+++ b/print-ppi.c
@@ -68,6 +68,7 @@ ppi_print(netdissect_options *ndo,
}
hdr = (const ppi_header_t *)p;
+ ND_TCHECK_16BITS(&hdr->ppi_len);
len = EXTRACT_LE_16BITS(&hdr->ppi_len);
if (caplen < len) {
/*
@@ -81,6 +82,7 @@ ppi_print(netdissect_options *ndo,
ND_PRINT((ndo, "[|ppi]"));
return (len);
}
+ ND_TCHECK_32BITS(&hdr->ppi_dlt);
dlt = EXTRACT_LE_32BITS(&hdr->ppi_dlt);
if (ndo->ndo_eflag)
@@ -104,6 +106,8 @@ ppi_print(netdissect_options *ndo,
hdrlen = 0;
}
return (len + hdrlen);
+trunc:
+ return (caplen);
}
/*