diff options
author | David Perry <boolean263@protonmail.com> | 2021-02-17 07:42:19 -0500 |
---|---|---|
committer | David Perry <boolean263@protonmail.com> | 2021-02-17 07:42:19 -0500 |
commit | 1965109ec7914a647b9fa5b31b0af8bbd4082dc7 (patch) | |
tree | ac39eab19641b32dc6f4bd560d406aedbdc75ccb /epan/dissectors/packet-vj-comp.c | |
parent | 2efed17b54a62ea82782bee6d4fd9bfab1999990 (diff) |
Fix null dereference in packet-vj-comp.c
I missed testing that `conv` wasn't null before passing it to
`conversation_get_proto_data()`. This fixes that.
Fixes #17238.
Diffstat (limited to 'epan/dissectors/packet-vj-comp.c')
-rw-r--r-- | epan/dissectors/packet-vj-comp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/dissectors/packet-vj-comp.c b/epan/dissectors/packet-vj-comp.c index 50ddeecb69..bd652f0707 100644 --- a/epan/dissectors/packet-vj-comp.c +++ b/epan/dissectors/packet-vj-comp.c @@ -446,12 +446,14 @@ dissect_vjc_comp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* } } conv = vjc_find_conversation(pinfo, vjc_cnum, FALSE); - if (NULL == conv) { + if (NULL != conv) { + pkt_data = (vjc_conv_t *)conversation_get_proto_data(conv, proto_vjc); + // Will be testing that pkt_data exists below + } + else { proto_tree_add_expert(ti, pinfo, &ei_vjc_no_conversation, tvb, 1, (flags & VJC_FLAG_C) ? 1 : 0); } - pkt_data = (vjc_conv_t *)conversation_get_proto_data(conv, proto_vjc); - // Will be testing that pkt_data exists below proto_tree_add_item_ret_uint(subtree, hf_vjc_chksum, tvb, offset, 2, ENC_BIG_ENDIAN, &tcp_chksum); |