From 5eb58b16ca7d34f8aac2cac8285405b3c3c72277 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 20 Jun 2024 09:12:22 +0200 Subject: [PATCH] examples: Make sure the array is probably initialized "Error: UNINIT (CWE-457): samba-4.20.0rc2/examples/libsmbclient/testacl2.c:27: var_decl: Declaring variable ""value"" without initializer. samba-4.20.0rc2/examples/libsmbclient/testacl2.c:48: uninit_use_in_call: Using uninitialized value ""*value"" as argument to ""%s"" when calling ""printf"". [Note: The source code implementation of the function has been overridden by a builtin model.] 46| } 47| 48|-> printf(""Attributes for [%s] are:\n%s\n"", argv[1], value); 49| 50| flags = 0;" Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke --- examples/libsmbclient/testacl2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/libsmbclient/testacl2.c b/examples/libsmbclient/testacl2.c index ee48b7b3059..ae9a76b5118 100644 --- a/examples/libsmbclient/testacl2.c +++ b/examples/libsmbclient/testacl2.c @@ -24,7 +24,7 @@ int main(int argc, const char *argv[]) static char *the_acl = NULL; int ret; const char *debugstr; - char value[1024]; + char value[1024] = {0}; SMBCCTX *context; if (smbc_init(get_auth_data_fn, debug) != 0) -- 2.47.2