From c91fe7bf01457937a4360fc49934575aebd24f59 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Mon, 12 Jan 2026 20:01:47 +0800 Subject: [PATCH] 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 --- system/nxinit/init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/system/nxinit/init.c b/system/nxinit/init.c index 1348c8c9d..b10253d13 100644 --- a/system/nxinit/init.c +++ b/system/nxinit/init.c @@ -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",