diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2015-05-17 15:58:17 +0200 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2015-05-18 21:08:57 +0000 |
commit | f33aa0c6d4fec670832b53cc6abd6b546205156c (patch) | |
tree | 2291bbaa151c47bdb76d66086a1e63ce94f5a70f /epan/dissectors/packet-dvbci.c | |
parent | 9d5a9fb1ff462646e04cb52971bfa7c16993d93b (diff) |
DVB-CI: fix a TPDU parsing error
if the response TPDU starts with 0x80 (T_SB), this is not an unknown
tag, it simply indicates that the optional header and body are absent
this bug was introduced in e597acdc4827ef62bc9597fdd248366411533a36
Change-Id: I076a0c9f0ea124e11edbb7a0bc0e41d1ab6f374a
Reviewed-on: https://code.wireshark.org/review/8527
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-dvbci.c')
-rw-r--r-- | epan/dissectors/packet-dvbci.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c index 4e62af1f7c..a29c7dbfed 100644 --- a/epan/dissectors/packet-dvbci.c +++ b/epan/dissectors/packet-dvbci.c @@ -4499,6 +4499,16 @@ dissect_dvbci_tpdu_hdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } else { r_tpdu_tag = tvb_get_guint8(tvb, 0); + if (r_tpdu_tag == T_SB) { + /* we have an r_tpdu without header and body, + it contains only the status part */ + if (hdr_tag) + *hdr_tag = NO_TAG; + if (body_len) + *body_len = 0; + return 0; + } + tag = &r_tpdu_tag; r_tpdu_str = try_val_to_str(r_tpdu_tag, dvbci_r_tpdu); pi = proto_tree_add_item(tree, hf_dvbci_r_tpdu_tag, tvb, 0, 1, ENC_BIG_ENDIAN); @@ -4506,21 +4516,10 @@ dissect_dvbci_tpdu_hdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%s", r_tpdu_str); } else { - if (r_tpdu_tag == T_SB) { - /* we have an r_tpdu without header and body, - it contains only the status part */ - if (hdr_tag) - *hdr_tag = NO_TAG; - if (body_len) - *body_len = 0; - return 0; - } - else { - col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, - "Invalid Response-TPDU tag"); - expert_add_info(pinfo, pi, &ei_dvbci_r_tpdu_tag); - return -1; - } + col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, + "Invalid Response-TPDU tag"); + expert_add_info(pinfo, pi, &ei_dvbci_r_tpdu_tag); + return -1; } } |