CSN_LEFT_ALIGNED_VAR_BMP didn't handle more than 8 bits.
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 26 Aug 2011 15:25:14 +0000 (15:25 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 26 Aug 2011 15:25:14 +0000 (15:25 +0000)
(CSN Ack/Nack Description wrongly handled in gsm_rlcmac_dl dissector )
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6101

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38745 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-csn1.c

index 122b65897cf87324ec8477c0ac5121fdab6163fb..fd933c25f7321c957d058fca6ff4ae90cedb0268 100644 (file)
@@ -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)