mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-27 20:30:41 +00:00
system/nxinit: Add missing "assert" entry to resetflag
Add the missing mapping entries in the resetflag[] array to prevent potential NULL pointer dereference when accessing reset.flag. The resetflag array uses designated initializers and must have entries for all BOARDIOC_SOFTRESETCAUSE_* values to avoid array holes. Reported by: xuchuntian@xiaomi.com Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
ee32ebda06
commit
c91fe7bf01
1 changed files with 1 additions and 0 deletions
|
|
@ -133,6 +133,7 @@ static int init_boot_reason(FAR struct action_manager_s *am)
|
|||
static FAR const char * const resetflag[] =
|
||||
{
|
||||
[BOARDIOC_SOFTRESETCAUSE_USER_REBOOT] = "reboot",
|
||||
[BOARDIOC_SOFTRESETCAUSE_ASSERT] = "assert",
|
||||
[BOARDIOC_SOFTRESETCAUSE_PANIC] = "kernel_panic",
|
||||
[BOARDIOC_SOFTRESETCAUSE_ENTER_BOOTLOADER] = "bootloader",
|
||||
[BOARDIOC_SOFTRESETCAUSE_ENTER_RECOVERY] = "recovery",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue