diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2016-12-22 22:16:43 +0100 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2016-12-23 08:59:51 +0000 |
commit | 933a73177736171214c2ae853fa3819fc09016bc (patch) | |
tree | 6452b23bdd2dbddce8778c43e35f10712b639965 /epan | |
parent | abe78e915e6d4aaa82b623865cadb95cc6402851 (diff) |
DVB-CI: don't call proto_tree_add_subtree_format() with tvb==NULL
When I first implemented this, proto_tree_add_subtree_format() worked
for tvb==NULL if len was also 0. The bounds check added in
56706427f53cc64793870bf072c2c06248ae88f3 breaks this use case and makes
DVB-CI spill out dissector asserts.
Warn Dissector bug, protocol DVB-CI, in packet 625:
../epan/tvbuff.c:532: failed assertion "tvb && tvb->initialized"
Create a proto_item first and link the subtree to this item. This will
work as long as proto_tree_add_uint() accepts tvb==NULL.
Thanks to Kay Katzorke for reporting this bug.
Change-Id: I25a071c21925f7d362c92852fd5a8136e4d361c8
Reviewed-on: https://code.wireshark.org/review/19389
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-dvbci.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c index 3626f1f359..9b9c036600 100644 --- a/epan/dissectors/packet-dvbci.c +++ b/epan/dissectors/packet-dvbci.c @@ -921,6 +921,7 @@ static int hf_dvbci_spdu_tag = -1; static int hf_dvbci_sess_status = -1; static int hf_dvbci_sess_nb = -1; static int hf_dvbci_close_sess_status = -1; +static int hf_dvbci_res_id = -1; static int hf_dvbci_res_id_type = -1; static int hf_dvbci_res_class = -1; static int hf_dvbci_res_type = -1; @@ -2657,8 +2658,8 @@ static proto_item * dissect_res_id(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, guint32 res_id, gboolean show_col_info) { - proto_item *ti = NULL; - proto_tree *res_tree = NULL; + proto_item *ti; + proto_tree *res_tree; gint tvb_data_len; /* there's two possible inputs for this function @@ -2689,8 +2690,9 @@ dissect_res_id(tvbuff_t *tvb, gint offset, packet_info *pinfo, RES_VER(res_id)); } - res_tree = proto_tree_add_subtree_format(tree, tvb, offset, tvb_data_len, - ett_dvbci_res, &ti, "Resource ID: 0x%04x", res_id); + ti = proto_tree_add_uint(tree, hf_dvbci_res_id, + tvb, offset, tvb_data_len, res_id); + res_tree = proto_item_add_subtree(ti, ett_dvbci_res); /* parameter "value" == complete resource id, RES_..._MASK will be applied by the hf definition */ @@ -5444,6 +5446,10 @@ proto_register_dvbci(void) { "Session Status", "dvb-ci.close_session_status", FT_UINT8, BASE_HEX, VALS(dvbci_close_sess_status), 0, NULL, HFILL } }, + { &hf_dvbci_res_id, + { "Resource ID", "dvb-ci.res.id", + FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } + }, { &hf_dvbci_res_id_type, { "Resource ID Type", "dvb-ci.res.id_type", FT_UINT32, BASE_HEX, NULL, RES_ID_TYPE_MASK, NULL, HFILL } |