diff options
author | Gerald Combs <gerald@wireshark.org> | 2012-04-06 00:32:26 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2012-04-06 00:32:26 +0000 |
commit | 1db28ae4698086bc84c4b7fa549b9a9613d6a572 (patch) | |
tree | c57d2cb7a5d3f71c88a9ca237dae21ca08ad3f6e /epan/tvbuff.c | |
parent | 81334e311aa9d417cbdccda7e48978befc85eae6 (diff) | |
download | wireshark-1db28ae4698086bc84c4b7fa549b9a9613d6a572.tar.gz wireshark-1db28ae4698086bc84c4b7fa549b9a9613d6a572.tar.bz2 wireshark-1db28ae4698086bc84c4b7fa549b9a9613d6a572.zip |
Clamp a value as suggested by Mike Morrin in bug 6878.
svn path=/trunk/; revision=41968
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r-- | epan/tvbuff.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index aa88539d64..1aa0b84147 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -1783,7 +1783,7 @@ _tvb_get_bits64(tvbuff_t *tvb, guint bit_offset, const gint total_no_of_bits) { /* the required bits don't extend to the end of the first octet */ guint8 right_shift = required_bits_in_first_octet - total_no_of_bits; - value = (tvb_get_guint8(tvb, octet_offset) >> right_shift) & bit_mask8[total_no_of_bits]; + value = (tvb_get_guint8(tvb, octet_offset) >> right_shift) & bit_mask8[total_no_of_bits % 8]; } else { |