From 64f9e8a4b76880cba545ab2e55447c38c690899b Mon Sep 17 00:00:00 2001 From: Old-Ding <35417409+Old-Ding@users.noreply.github.com> Date: Mon, 6 Jul 2026 09:30:13 +0800 Subject: [PATCH] system: nxinit: bound debug argv dump Check the service argv array bound before reading the current entry in the debug dump loop. A full argument array may not have an in-array NULL terminator, so the old condition could read one entry past the array while CONFIG_SYSTEM_NXINIT_DEBUG is enabled. Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com> --- system/nxinit/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/nxinit/service.c b/system/nxinit/service.c index 7e840e7e7..8a92bb20b 100644 --- a/system/nxinit/service.c +++ b/system/nxinit/service.c @@ -677,7 +677,7 @@ void init_dump_service(FAR struct service_s *s) init_debug(" pid: %d", s->pid); init_debug(" arguments:"); - for (i = 0; s->argv[i] && i < nitems(s->argv); i++) + for (i = 0; i < nitems(s->argv) && s->argv[i]; i++) { init_debug(" [%d] '%s'", i, s->argv[i]); }