This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit c91fe7bf01457937a4360fc49934575aebd24f59
Author: wangjianyu3 <[email protected]>
AuthorDate: Mon Jan 12 20:01:47 2026 +0800

    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: [email protected]
    Signed-off-by: wangjianyu3 <[email protected]>
---
 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",

Reply via email to