diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2014-02-23 23:32:03 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2014-02-23 22:41:45 +0000 |
commit | a8676c2fd756176136ec48c1dace955ebebe640c (patch) | |
tree | 3bcd4f67aa926bcd57719ab5fac9fa8750cb990c /epan/dissectors/packet-gsm_a_common.c | |
parent | 1678b0a825b41c0beb5fdfe6d43543a03b294ac8 (diff) |
Fix dissection of BCD numbers
Do not use of tvb_get_string(): what we really want is the byte string, not an ASCII string
Change-Id: I8b9a8b7ccacbdaf6d9525771ff8ed883ba01ad34
Reviewed-on: https://code.wireshark.org/review/329
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-gsm_a_common.c')
-rw-r--r-- | epan/dissectors/packet-gsm_a_common.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/epan/dissectors/packet-gsm_a_common.c b/epan/dissectors/packet-gsm_a_common.c index 3680e03a2e..b676e20b30 100644 --- a/epan/dissectors/packet-gsm_a_common.c +++ b/epan/dissectors/packet-gsm_a_common.c @@ -6,8 +6,6 @@ * * Split from packet-gsm_a.c by Neil Piercy <Neil [AT] littlebriars.co.uk> * - * $Id$ - * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs @@ -1927,14 +1925,14 @@ guint16 elem_v_short(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint p static dgt_set_t Dgt_tbcd = { { - /* 0 1 2 3 4 5 6 7 8 9 a b c d e */ + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ '0','1','2','3','4','5','6','7','8','9','?','B','C','*','#','?' } }; static dgt_set_t Dgt1_9_bcd = { { - /* 0 1 2 3 4 5 6 7 8 9 a b c d e */ + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?','?' } }; @@ -2288,7 +2286,7 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin a_bigbuf[0] = Dgt1_9_bcd.out[(oct & 0xf0) >> 4]; curr_offset++; - poctets = tvb_get_string(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset)); + poctets = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset)); my_dgt_tbcd_unpack(&a_bigbuf[1], poctets, len - (curr_offset - offset), &Dgt1_9_bcd); |