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

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

commit 1503c29f5d31d2b564fa067e3d6a160c48002a16
Author: wangjianyu3 <[email protected]>
AuthorDate: Fri Dec 26 11:45:17 2025 +0800

    system/nxinit: Fix index underflow issue
    
    Decrementing i when it's 0 in "for (; i >= 0; i--)" causes size_t
    underflow to a huge value.
    
    Signed-off-by: wangjianyu3 <[email protected]>
---
 system/nxinit/action.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/system/nxinit/action.c b/system/nxinit/action.c
index eea662001..a8ce57da8 100644
--- a/system/nxinit/action.c
+++ b/system/nxinit/action.c
@@ -176,7 +176,7 @@ static int parse_event(FAR char *buf, FAR struct 
action_event_s *events,
           return 0;
         }
 
-      for (; i >= 0; i--)
+      while (i-- > 0)
         {
           if (events[i].key)
             {

Reply via email to