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.
This commit is contained in:
Stig Bjørlykke 2020-10-12 10:08:18 +02:00 committed by Wireshark GitLab Utility
parent 88b0370f86
commit a750cab655
1 changed files with 4 additions and 0 deletions

View File

@ -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);