forked from osmocom/wireshark
couchbase: check shift value before use.
Bug: 15439 Change-Id: I5bd702333795f2ed705eadb665516cb27b6e0371 Reviewed-on: https://code.wireshark.org/review/32311 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
67b1db7815
commit
52203676cc
|
@ -1685,6 +1685,9 @@ dissect_unsigned_leb128(tvbuff_t *tvb, gint start, gint end, guint32* value) {
|
|||
gint byte_idx;
|
||||
for (byte_idx = start+1; byte_idx < end; byte_idx++) {
|
||||
byte = tvb_get_guint8(tvb, byte_idx);
|
||||
/* Ensure we are using a valid shift */
|
||||
if (shift > 32)
|
||||
return -1;
|
||||
*value |= (byte & 0x7f) << shift;
|
||||
if ((byte & 0x80) == 0) {
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue