From: Andreas Schneider Date: Thu, 20 Jun 2024 07:12:22 +0000 (+0200) Subject: examples: Make sure the array is probably initialized X-Git-Tag: tdb-1.4.11~248 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5eb58b16ca7d34f8aac2cac8285405b3c3c72277;p=thirdparty%2Fsamba.git 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 --- 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)