X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/49b23c5a9b0198bb382dcf43c458d46fcf2fa809..12f66f69f7bf1ec1266ddbee90a7616cbf33696b:/print-ppi.c diff --git a/print-ppi.c b/print-ppi.c index 72cd1b86..66b75821 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); } /*