Remove PRI macro control in wasm_application.c (#905)

And fix read_leb byte count check issue in aot_compiler.c
This commit is contained in:
Wenyong Huang
2021-12-20 19:22:28 +08:00
committed by GitHub
parent 4cc4625a2b
commit af251e45ca
2 changed files with 3 additions and 20 deletions

View File

@ -64,8 +64,9 @@ read_leb(const uint8 *buf, const uint8 *buf_end, uint32 *p_offset,
}
bcnt += 1;
}
if (bcnt > (((maxbits + 8) >> 3) - (maxbits + 8))) {
aot_set_last_error("read leb failed: unsigned leb overflow.");
if (bcnt > (maxbits + 6) / 7) {
aot_set_last_error("read leb failed: "
"integer representation too long");
return false;
}
if (sign && (shift < maxbits) && (byte & 0x40)) {