Fix large allocation bug in wasm parser ##fuzz

This commit is contained in:
pancake 2022-09-12 17:31:12 +02:00
parent dc9f7df3bd
commit 3df30c7e9e

View File

@ -423,7 +423,9 @@ static inline RPVector *parse_vec(RBinWasmObj *bin, ut64 bound, ParseEntryFcn pa
if (!consume_u32_r (buf, bound, &count)) {
return NULL;
}
if (count > r_buf_size (buf)) {
count = r_buf_size (buf) - r_buf_tell (buf);
}
RPVector *vec = r_pvector_new (free_entry);
if (vec) {
r_pvector_reserve (vec, count);