1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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 <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
This commit is contained in:
Andreas Schneider 2024-06-20 09:12:22 +02:00 committed by Martin Schwenke
parent 384d948b8d
commit 5eb58b16ca

View File

@ -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)