sim: use correct size to avoid buffer overflow

Fix buffer overflow issue from PR #10128, since the sizeof
xcpt_reg_t is different on 32/64 bit platform.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
This commit is contained in:
chenxiaoyi 2023-08-11 16:26:01 +08:00 committed by Xiang Xiao
parent 60c4d61c02
commit fd34be15eb

View File

@ -113,7 +113,7 @@ void up_initial_state(struct tcb_s *tcb)
/* Mask the interrupt until switching to the new task */
memset(&tcb->xcp.regs[JB_FLAG], 0xff, sizeof(xcpt_reg_t) * 2);
memset(&tcb->xcp.regs[JB_FLAG], 0xff, sizeof(uint32_t) * 2);
tcb->xcp.regs[JB_PC] = (xcpt_reg_t)pre_start;