mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-26 07:44:29 +00:00
Fix CID #1195065
This commit is contained in:
parent
d5908941fb
commit
14f3c113d3
@ -23,8 +23,13 @@ R_API const ut8 *r_leb128 (const ut8 *data, st64 *v) {
|
||||
s += 7;
|
||||
if (!(c & 0x80)) break;
|
||||
}
|
||||
/* FIXME: More proper sum calculation */
|
||||
if ((s < (8 * sizeof (sum))) && (c & 0x40)) {
|
||||
sum |= -(1 << s);
|
||||
if (sum > 31) {
|
||||
sum |= -(1 << s);
|
||||
} else {
|
||||
eprintf ("r_len128(): s is too big (>31) - undefined behaviour!\n");
|
||||
}
|
||||
}
|
||||
if (v) *v = sum;
|
||||
return data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user