Fix two more ooms in wasm and xtac

This commit is contained in:
pancake 2023-03-04 23:01:24 +01:00
parent 4643eb5e46
commit c16d89d8dd
2 changed files with 4 additions and 1 deletions

View File

@ -190,7 +190,7 @@ static size_t consume_init_expr_r(RBuffer *b, ut64 bound, ut8 eoc, void *out) {
static size_t consume_locals_r(RBuffer *b, ut64 bound, RBinWasmCodeEntry *out) {
r_return_val_if_fail (out, 0);
ut32 count = out->local_count;
if (count <= 0) {
if ((st32)count <= 0) {
return 0;
}
out->locals = R_NEWS0 (struct r_bin_wasm_local_entry_t, count);

View File

@ -285,6 +285,9 @@ static bool r_bin_xtac_read_address_pairs(RBinXtacObj *bin) {
const ut32 n_addr_pairs = bin->header->num_of_addr_pairs;
const ut32 addr_pair_size = n_addr_pairs * sizeof (X86ArmAddrPair);
const ut32 p_addr_pair = bin->header->ptr_to_addr_pairs;
if (n_addr_pairs > 0xfffff) {
return false;
}
if (!(bin->address_pairs = R_NEWS0 (X86ArmAddrPair, n_addr_pairs))) {
return false;
}