fix buf checking in load_table_section (#4276)

Signed-off-by: Su Yihan <yihan.su@intel.com>
This commit is contained in:
Su Yihan 2025-05-14 06:35:32 +08:00 committed by GitHub
parent 477d66d00f
commit 26aa4830e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3833,11 +3833,11 @@ load_table_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,
uint8 flag; uint8 flag;
bool has_init = false; bool has_init = false;
CHECK_BUF(buf, buf_end, 1); CHECK_BUF(p, p_end, 1);
flag = read_uint8(p); flag = read_uint8(p);
if (flag == TABLE_INIT_EXPR_FLAG) { if (flag == TABLE_INIT_EXPR_FLAG) {
CHECK_BUF(buf, buf_end, 1); CHECK_BUF(p, p_end, 1);
flag = read_uint8(p); flag = read_uint8(p);
if (flag != 0x00) { if (flag != 0x00) {