forked from osmocom/wireshark
dwarf: fix bug found by MSVC2013 Code Analysis
The following doesn't quite do what it might seem to be doing: *value |= (byte & 0x7F) << shift; //guint64 *value // guint8 byte The warning from MSVC2013: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value Change-Id: I06e196559ec0e84da77d8866355ae7f86ba43f73 Reviewed-on: https://code.wireshark.org/review/7020 Reviewed-by: Bill Meier <wmeier@newsguy.com>
This commit is contained in:
parent
f494abdf6c
commit
14c37afb5d
|
@ -39,7 +39,7 @@ dissect_uleb128(tvbuff_t *tvb, gint offset, guint64 *value)
|
|||
byte = tvb_get_guint8(tvb, offset);
|
||||
offset += 1;
|
||||
|
||||
*value |= (byte & 0x7F) << shift;
|
||||
*value |= ((guint64)(byte & 0x7F) << shift);
|
||||
shift += 7;
|
||||
} while (byte & 0x80);
|
||||
|
||||
|
@ -59,7 +59,7 @@ dissect_leb128(tvbuff_t *tvb, gint offset, gint64 *value)
|
|||
byte = tvb_get_guint8(tvb, offset);
|
||||
offset += 1;
|
||||
|
||||
*value |= (byte & 0x7F) << shift;
|
||||
*value |= ((guint64)(byte & 0x7F) << shift);
|
||||
shift += 7;
|
||||
} while (byte & 0x80);
|
||||
|
||||
|
|
Loading…
Reference in New Issue