summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-10-17 13:55:33 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-10-17 13:56:40 +0200
commitf902b5585a6272a283cc725caee74f9e584eaf27 (patch)
tree4cf992434d4f85b39d0956f13d43cc8c32c9d691
parent05c0608e6f9a0e894bb421beca01b897d02fe5b6 (diff)
downloadtcpdump-f902b5585a6272a283cc725caee74f9e584eaf27.tar.gz
Bluetooth: Use ND_TCHECK_LEN() for a bounds check
Moreover: Define ND_LONGJMP_FROM_TCHECK.
-rw-r--r--print-bt.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/print-bt.c b/print-bt.c
index 406051f4..131bc711 100644
--- a/print-bt.c
+++ b/print-bt.c
@@ -25,6 +25,7 @@
#include "netdissect-stdinc.h"
+#define ND_LONGJMP_FROM_TCHECK
#include "netdissect.h"
#include "extract.h"
@@ -55,11 +56,7 @@ bt_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *
ndo->ndo_protocol = "bluetooth";
nd_print_protocol(ndo);
- if (caplen < BT_HDRLEN) {
- ndo->ndo_ll_hdr_len += caplen;
- nd_print_trunc(ndo);
- return;
- }
+ ND_TCHECK_LEN(p, BT_HDRLEN);
ndo->ndo_ll_hdr_len += BT_HDRLEN;
caplen -= BT_HDRLEN;
length -= BT_HDRLEN;