diff options
author | Anders Broman <anders.broman@ericsson.com> | 2011-08-26 15:25:14 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2011-08-26 15:25:14 +0000 |
commit | e0645e724c63c956ddac4a50a5b2d29c3800c002 (patch) | |
tree | 1381487591c77fc3db74349d340925ad49b58a96 /epan/dissectors/packet-csn1.c | |
parent | 740eaf0b6ada60db8cf89ff2fcce93be4d906b03 (diff) |
CSN_LEFT_ALIGNED_VAR_BMP didn't handle more than 8 bits.
(CSN Ack/Nack Description wrongly handled in gsm_rlcmac_dl dissector )
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6101
svn path=/trunk/; revision=38745
Diffstat (limited to 'epan/dissectors/packet-csn1.c')
-rw-r--r-- | epan/dissectors/packet-csn1.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/epan/dissectors/packet-csn1.c b/epan/dissectors/packet-csn1.c index 122b65897c..fd933c25f7 100644 --- a/epan/dissectors/packet-csn1.c +++ b/epan/dissectors/packet-csn1.c @@ -1174,10 +1174,24 @@ csnStreamDissector(proto_tree *tree, csnStream_t* ar, const CSN_DESCR* pDescr, t no_of_bits += pDescr->i;/* size adjusted by offset */ if (no_of_bits > 0) - { /* a non empty bitmap */ - proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s", - decode_bits_in_field(bit_offset, no_of_bits, tvb_get_bits8(tvb, bit_offset, no_of_bits)), + { + if (no_of_bits <= 32) + { + proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s", + decode_bits_in_field(bit_offset, no_of_bits, tvb_get_bits32(tvb, bit_offset, no_of_bits, FALSE)), pDescr->sz); + } + else if (no_of_bits <= 64) + { + proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %s", + decode_bits_in_field(bit_offset, no_of_bits, tvb_get_bits64(tvb, bit_offset, no_of_bits, FALSE)), + pDescr->sz); + } + else + { + proto_tree_add_text(tree, tvb, bit_offset>>3, (no_of_bits>>3)+1, "%s %u bits", + pDescr->sz, no_of_bits); + } remaining_bits_len -= no_of_bits; if (remaining_bits_len < 0) |