Skip to content

Commit 34da8f9

Browse files
committed
[DM][PIC] Fix #10998
The size of cpumask is `RT_CPUS_NR`, memset force to space will overflow in stack. Signed-off-by: GuEe-GUI <[email protected]>
1 parent c79b00e commit 34da8f9

File tree

1 file changed

+2
-2
lines changed
  • components/drivers/pic

1 file changed

+2
-2
lines changed

components/drivers/pic/pic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,11 +1254,11 @@ static int list_irq(int argc, char**argv)
12541254

12551255
rt_kputs(info);
12561256
#ifdef RT_USING_SMP
1257+
rt_kputs(cpumask);
12571258
if (RT_CPUS_NR < 4)
12581259
{
1259-
rt_memset(&cpumask[RT_CPUS_NR], ' ', 4 - RT_CPUS_NR);
1260+
rt_kprintf("%-*.s", 4 - RT_CPUS_NR, " ");
12601261
}
1261-
rt_kputs(cpumask);
12621262
#endif
12631263

12641264
#ifdef RT_USING_INTERRUPT_INFO

0 commit comments

Comments
 (0)