mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
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 <fangxinyong@xiaomi.com>
This commit is contained in:
@@ -61,6 +61,8 @@ int posix_spawnattr_init(posix_spawnattr_t *attr)
|
|||||||
|
|
||||||
DEBUGASSERT(attr);
|
DEBUGASSERT(attr);
|
||||||
|
|
||||||
|
memset(attr, 0, sizeof(*attr));
|
||||||
|
|
||||||
/* Flags: None */
|
/* Flags: None */
|
||||||
|
|
||||||
attr->flags = 0;
|
attr->flags = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user