You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2026/01/21 12:31:48 UTC
(nuttx) 06/07: libs/libc: posix_spawnattr_init zero-initialize attr
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit d38078b778d539bd7e1db2170559888e4e09e08d
Author: fangxinyong <fa...@xiaomi.com>
AuthorDate: Sun Sep 14 14:13:42 2025 +0800
libs/libc: posix_spawnattr_init zero-initialize attr
Zero-initialize posix_spawnattr_t in posix_spawnattr_init().
Prevent use of uninitialized fields reported by Coverity.
Preserve existing default flag initialization.
Signed-off-by: fangxinyong <fa...@xiaomi.com>
---
libs/libc/spawn/lib_psa_init.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libs/libc/spawn/lib_psa_init.c b/libs/libc/spawn/lib_psa_init.c
index aaff5ea5a9e..20313348710 100644
--- a/libs/libc/spawn/lib_psa_init.c
+++ b/libs/libc/spawn/lib_psa_init.c
@@ -61,6 +61,8 @@ int posix_spawnattr_init(posix_spawnattr_t *attr)
DEBUGASSERT(attr);
+ memset(attr, 0, sizeof(*attr));
+
/* Flags: None */
attr->flags = 0;