diff options
author | Anders Broman <anders.broman@ericsson.com> | 2020-12-10 13:14:21 +0100 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2020-12-10 16:02:10 +0100 |
commit | 9a46fabf5299fb0b634dfc0f6368d8201e847d73 (patch) | |
tree | 8a3cd1a11130d56cb10182fddfddaabc79d5cf12 /epan/dissectors/packet-e212.c | |
parent | 37f11e9a364c4b3684db52c3f4ad4773034a90a0 (diff) |
Introduce ENC_BCD_ODD_NUM_DIG in order to handle odd number of digits
Diffstat (limited to 'epan/dissectors/packet-e212.c')
-rw-r--r-- | epan/dissectors/packet-e212.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/dissectors/packet-e212.c b/epan/dissectors/packet-e212.c index cb96611204..b979c6d292 100644 --- a/epan/dissectors/packet-e212.c +++ b/epan/dissectors/packet-e212.c @@ -3468,14 +3468,17 @@ dissect_e212_imsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offse { proto_item *item; proto_tree *subtree; - const gchar *imsi_str; + const guint8 *imsi_str; /* Fetch the BCD encoded digits from tvb indicated half byte, formating the digits according to * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the wmem * allocated string will be returned. */ - imsi_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, length, NULL, skip_first); - item = proto_tree_add_string(tree, hf_E212_imsi, tvb, offset, length, imsi_str); + if (skip_first) { + item = proto_tree_add_item_ret_string(tree, hf_E212_imsi, tvb, offset, length, ENC_BCD_DIGITS_0_9 | ENC_BCD_SKIP_FIRST, wmem_packet_scope(), &imsi_str); + } else { + item = proto_tree_add_item_ret_string(tree, hf_E212_imsi, tvb, offset, length, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &imsi_str); + } if (!is_imsi_string_valid(imsi_str)) { expert_add_info(pinfo, item, &ei_E212_imsi_malformed); } |