summaryrefslogtreecommitdiff
path: root/print-ppi.c
diff options
context:
space:
mode:
authorPhilip Paeps <philip@FreeBSD.org>2019-10-06 04:36:53 +0000
committerPhilip Paeps <philip@FreeBSD.org>2019-10-06 04:36:53 +0000
commitf91036a44a189fa5d0b5f1c6dea0a396a0f928c0 (patch)
tree2cd0554d9f0826a4e0bc63c5e4ca83ece65bee24 /print-ppi.c
parent810711ec13a9424633df50e0a1af057a68e2ed45 (diff)
Notes
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 72cd1b867fd50..66b7582150155 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);
}
/*