aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-per.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2011-10-25 05:46:31 +0000
committerAnders Broman <anders.broman@ericsson.com>2011-10-25 05:46:31 +0000
commit585ee5026dad74885f3e198628f287f1986b7168 (patch)
tree8097ab41670123ffd14e518d65f912cad95c7b12 /epan/dissectors/packet-per.c
parent42eb7297b4afc09bced94ba1cdb43654356d6d05 (diff)
From Neil Piercy:
The binary display and decimal values are corrupt in the case where they are "stitched" together from words and octets: the complete words are extracted ready for LSB padding, but when the final octet/word is added (also so extracted), the data already present is shifted by a whole number of octets (not allowing for the padding), and the value is then used by the binary and decimal display functions as if it were MSB padded. This results in both a corrupt bit pattern and wrong padding of the bit pattern in the display. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6473 svn path=/trunk/; revision=39553
Diffstat (limited to 'epan/dissectors/packet-per.c')
-rw-r--r--epan/dissectors/packet-per.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c
index 60dd9c71b4..e124338c0b 100644
--- a/epan/dissectors/packet-per.c
+++ b/epan/dissectors/packet-per.c
@@ -1998,23 +1998,23 @@ static tvbuff_t *dissect_per_bit_string_display(tvbuff_t *tvb, guint32 offset, a
value = tvb_get_bits16(out_tvb, 0, length, ENC_BIG_ENDIAN);
}else if (length<=24) { /* first read 16 and then the remaining bits */
value = tvb_get_bits16(out_tvb, 0, 16, ENC_BIG_ENDIAN);
- value <<= 8;
+ value <<= 8 - pad_length;
value |= tvb_get_bits8(out_tvb, 16, length - 16);
}else if (length<=32) {
value = tvb_get_bits32(out_tvb, 0, length, ENC_BIG_ENDIAN);
}else if (length<=40) { /* first read 32 and then the remaining bits */
value = tvb_get_bits32(out_tvb, 0, 32, ENC_BIG_ENDIAN);
- value <<= 8;
+ value <<= 8 - pad_length;
value |= tvb_get_bits8(out_tvb, 32, length - 32);
}else if (length<=48) { /* first read 32 and then the remaining bits */
value = tvb_get_bits32(out_tvb, 0, 32, ENC_BIG_ENDIAN);
- value <<= 16;
+ value <<= 16 - pad_length;
value |= tvb_get_bits16(out_tvb, 32, length - 32, ENC_BIG_ENDIAN);
}else if (length<=56) { /* first read 32 and 16 then the remaining bits */
value = tvb_get_bits32(out_tvb, 0, 32, ENC_BIG_ENDIAN);
- value <<= 16;
+ value <<= 16
value |= tvb_get_bits16(out_tvb, 32, 16, ENC_BIG_ENDIAN);
- value <<= 8;
+ value <<= 8 - pad_length;
value |= tvb_get_bits8(out_tvb, 48, length - 48);
}else {
value = tvb_get_bits64(out_tvb, 0, length, ENC_BIG_ENDIAN);