aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_a_common.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-11-09 08:58:42 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-11-09 08:58:42 +0000
commit7a4b3598231ea6764b19cb32827bc871a6992bac (patch)
treef6677296bd32689e1c4814e4fbb93fe2cc84afef /epan/dissectors/packet-gsm_a_common.c
parentca21cf8083583f2620ac9d99485a7c4e0bc0e29f (diff)
GSM classmark3 8-PSK decode error
proto_tree_add_bits_item() can't be called with a length value of -1. Calculate the value, fixes BUG: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7964 #BACKOPRT svn path=/trunk/; revision=45980
Diffstat (limited to 'epan/dissectors/packet-gsm_a_common.c')
-rw-r--r--epan/dissectors/packet-gsm_a_common.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/epan/dissectors/packet-gsm_a_common.c b/epan/dissectors/packet-gsm_a_common.c
index df8175d328..b02921950a 100644
--- a/epan/dissectors/packet-gsm_a_common.c
+++ b/epan/dissectors/packet-gsm_a_common.c
@@ -2625,8 +2625,23 @@ de_ms_cm_3(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset,
if (eightPskStructPresent == 1)
{
+ /* At lest Modulation Capability and cap1,cap2 presens indicators is present */
+ guint8 psk_struct_len = 3;
+ guint32 tmp_bit_offset = bit_offset;
+
+ /* Check if Power Capability 1 is present */
+ tmp_bit_offset++;
+ if(tvb_get_bits8(tvb,tmp_bit_offset,1) == 1){
+ psk_struct_len+=2;
+ tmp_bit_offset+=2;
+ }
+ tmp_bit_offset++;
+ /* Check if Power Capability 2 is present */
+ if(tvb_get_bits8(tvb,tmp_bit_offset,1) == 1){
+ psk_struct_len+=2;
+ }
/* Extract 8-PSK struct */
- item = proto_tree_add_bits_item(tree, hf_gsm_a_8_psk_struct, tvb, bit_offset, -1, ENC_BIG_ENDIAN);
+ item = proto_tree_add_bits_item(tree, hf_gsm_a_8_psk_struct, tvb, bit_offset, psk_struct_len, ENC_BIG_ENDIAN);
subtree = proto_item_add_subtree(item, ett_gsm_common_elem[DE_MS_CM_3]);
old_bit_offset = bit_offset;