mirror of
https://github.com/rizinorg/rizin.git
synced 2026-10-11 22:19:51 +00:00
Partially port bound checks from radare2/6727454b666b28c33837b219a5f91136461357c0
Co-authored-by: pancake <[email protected]>
This commit is contained in:
committed by
Giovanni
co-authored by
pancake
parent
a084234d7f
commit
b9515bb51e
@@ -69,6 +69,8 @@ static double get_float64(RzBuffer *buffer, bool *error) {
|
||||
}
|
||||
|
||||
static ut8 *get_bytes(RzBuffer *buffer, ut32 size) {
|
||||
rz_return_val_if_fail(size < ST32_MAX && buffer, NULL);
|
||||
|
||||
ut8 *ret = RZ_NEWS0(ut8, size + 1);
|
||||
if (!ret) {
|
||||
return NULL;
|
||||
@@ -208,14 +210,14 @@ static pyc_object *get_long_object(RzBuffer *buffer) {
|
||||
tmp |= n << left;
|
||||
left += 15;
|
||||
|
||||
while (left >= 4) {
|
||||
while (left >= 4 && j > 0) {
|
||||
hexstr[--j] = digist2hex[tmp & 0xf];
|
||||
tmp >>= 4;
|
||||
left -= 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp) {
|
||||
if (tmp && j > 0) {
|
||||
hexstr[--j] = digist2hex[tmp & 0xf];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user