Fix for bug 4209:
authordimeg <dimeg@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 6 Nov 2009 21:20:17 +0000 (21:20 +0000)
committerdimeg <dimeg@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 6 Nov 2009 21:20:17 +0000 (21:20 +0000)
After reading a SysID group, current_offset was off by 1

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

epan/dissectors/packet-gsm_a_dtap.c

index bb2d883df2a242855ffe3b99106f06258fb87c42..29c5658eda107bb0c6dc8b5766873f10f3933710 100644 (file)
@@ -3449,9 +3449,9 @@ de_sup_codec_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_
                /*      Length Of Bitmap for SysID */
                proto_tree_add_item(tree, hf_gsm_a_bitmap_length, tvb, curr_offset, 1, FALSE);
                length = tvb_get_guint8(tvb,curr_offset);
+               curr_offset++;
         if (length > 0)
                {
-                       curr_offset++;
                        item = proto_tree_add_text(tree, tvb, curr_offset, length, "Codec Bitmap for SysID %u", sysid_counter);
                        subtree = proto_item_add_subtree(item, ett_gsm_dtap_elem[DE_SUP_CODEC_LIST]);
                        /* 6.2 Codec Bitmap
@@ -3482,6 +3482,7 @@ de_sup_codec_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_
                        proto_tree_add_item(subtree, hf_gsm_a_codec_gsm_efr, tvb, curr_offset, 1, FALSE);
                        proto_tree_add_item(subtree, hf_gsm_a_codec_gsm_hr, tvb, curr_offset, 1, FALSE);
                        proto_tree_add_item(subtree, hf_gsm_a_codec_gsm_fr, tvb, curr_offset, 1, FALSE);
+                       curr_offset++;
                        length--;
 
                        if (length > 0)
@@ -3489,7 +3490,6 @@ de_sup_codec_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_
                                /*
                                 * We can proceed with the second octet of the bitmap
                                 */
-                               curr_offset++;
                                proto_tree_add_bits_item(subtree, hf_gsm_a_dtap_spare_bits, tvb, curr_offset << 3, 2, FALSE);
                                proto_tree_add_item(subtree, hf_gsm_a_codec_ohr_amr_wb, tvb, curr_offset, 1, FALSE);
                                proto_tree_add_item(subtree, hf_gsm_a_codec_ofr_amr_wb, tvb, curr_offset, 1, FALSE);
@@ -3497,6 +3497,7 @@ de_sup_codec_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_
                                proto_tree_add_item(subtree, hf_gsm_a_codec_umts_amr_wb, tvb, curr_offset, 1, FALSE);
                                proto_tree_add_item(subtree, hf_gsm_a_codec_fr_amr_wb, tvb, curr_offset, 1, FALSE);
                                proto_tree_add_item(subtree, hf_gsm_a_codec_pdc_efr, tvb, curr_offset, 1, FALSE);
+                               curr_offset++;
                                length--;
                        }
                }