mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 13:27:01 +08:00
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:
@@ -113,7 +113,7 @@ void up_initial_state(struct tcb_s *tcb)
|
|||||||
|
|
||||||
/* Mask the interrupt until switching to the new task */
|
/* 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;
|
tcb->xcp.regs[JB_PC] = (xcpt_reg_t)pre_start;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user