From ef2869ecb72f85fbb452094b45fa53743a23d086 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Thu, 27 Apr 2023 13:19:34 +0200 Subject: PPP: Check if there is some data to hexdump This may avoid this error: Dissector error: print_unknown_data() called with pointer past end of packet Add a test file showing the problem. --- print-ppp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'print-ppp.c') diff --git a/print-ppp.c b/print-ppp.c index aba243dd..38505355 100644 --- a/print-ppp.c +++ b/print-ppp.c @@ -1131,7 +1131,7 @@ print_ipcp_config_options(netdissect_options *ndo, print_unknown_data(ndo, p + 2, "\n\t ", len - 2); break; } - if (ndo->ndo_vflag > 1) + if (ndo->ndo_vflag > 1 && ND_TTEST_LEN(p + 2, len - 2)) print_unknown_data(ndo, p + 2, "\n\t ", len - 2); /* exclude TLV header */ return len; -- cgit v1.2.1