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:
wangjianyu3 2026-01-12 20:01:47 +08:00 committed by Alan C. Assis
parent ee32ebda06
commit c91fe7bf01

View file

@ -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",