diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2020-10-12 10:08:18 +0200 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2020-10-12 12:30:31 +0000 |
commit | a750cab655515904022c6a62651a855077a49315 (patch) | |
tree | 648e9230c4d481ecc02f29e3b8cc5b0a37b9c5d1 /epan/dissectors/packet-thread.c | |
parent | 88b0370f867191c4d8d005f3b21d6502f868b1d8 (diff) |
thread: Add check for valid CoAP info
Add a check for valid CoAP info in dissect_thread_coap() before use.
It may happen that this is NULL because setting a decode_as rule
for application/octet-stream will also catch other packets.
Diffstat (limited to 'epan/dissectors/packet-thread.c')
-rw-r--r-- | epan/dissectors/packet-thread.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/dissectors/packet-thread.c b/epan/dissectors/packet-thread.c index 49cd9a6f06..588ac2f9cb 100644 --- a/epan/dissectors/packet-thread.c +++ b/epan/dissectors/packet-thread.c @@ -2105,6 +2105,10 @@ dissect_thread_coap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d /* Obtain the CoAP info */ coinfo = (coap_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_coap, 0); + + /* Reject the packet if not CoAP */ + if (!coinfo) return 0; + uri = wmem_strbuf_get_str(coinfo->uri_str_strbuf); tokens = wmem_strsplit(wmem_packet_scope(), uri, "/", 3); |