summaryrefslogtreecommitdiffstats
path: root/freebsd/contrib/tcpdump/print-ppi.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/contrib/tcpdump/print-ppi.c')
-rw-r--r--freebsd/contrib/tcpdump/print-ppi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/freebsd/contrib/tcpdump/print-ppi.c b/freebsd/contrib/tcpdump/print-ppi.c
index d1faa7f2..b717c0bb 100644
--- a/freebsd/contrib/tcpdump/print-ppi.c
+++ b/freebsd/contrib/tcpdump/print-ppi.c
@@ -74,6 +74,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) {
/*
@@ -87,6 +88,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)
@@ -110,6 +112,8 @@ ppi_print(netdissect_options *ndo,
hdrlen = 0;
}
return (len + hdrlen);
+trunc:
+ return (caplen);
}
/*