diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-10-17 13:55:33 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-10-17 13:56:40 +0200 |
commit | f902b5585a6272a283cc725caee74f9e584eaf27 (patch) | |
tree | 4cf992434d4f85b39d0956f13d43cc8c32c9d691 | |
parent | 05c0608e6f9a0e894bb421beca01b897d02fe5b6 (diff) | |
download | tcpdump-f902b5585a6272a283cc725caee74f9e584eaf27.tar.gz |
Bluetooth: Use ND_TCHECK_LEN() for a bounds check
Moreover:
Define ND_LONGJMP_FROM_TCHECK.
-rw-r--r-- | print-bt.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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; |