Partially port bound checks from radare2/6727454b666b28c33837b219a5f91136461357c0

Co-authored-by: pancake <[email protected]>
This commit is contained in:
Rot127
2026-09-26 13:02:24 +01:00
committed by Giovanni
co-authored by pancake
parent a084234d7f
commit b9515bb51e
+4 -2
View File
@@ -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];
}