From: Andreas Schneider Date: Mon, 24 Jun 2024 13:17:13 +0000 (+0200) Subject: examples: Initialize char arrays X-Git-Tag: tdb-1.4.11~272 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=909506c91c1660f124d772b5caa0191f10ee320c;p=thirdparty%2Fsamba.git examples: Initialize char arrays "Error: UNINIT (CWE-457): samba-4.20.0rc2/examples/libsmbclient/testacl3.c:15: var_decl: Declaring variable ""value"" without initializer. samba-4.20.0rc2/examples/libsmbclient/testacl3.c:55: 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.] 53| } 54| 55|-> printf(""Attributes for [%s] are:\n%s\n"", path, value); 56| } 57|" Signed-off-by: Andreas Schneider Reviewed-by: Noel Power --- diff --git a/examples/libsmbclient/testacl3.c b/examples/libsmbclient/testacl3.c index e5ec2c88b95..2e3ee5d4c3c 100644 --- a/examples/libsmbclient/testacl3.c +++ b/examples/libsmbclient/testacl3.c @@ -12,8 +12,8 @@ int main(int argc, char * argv[]) { int ret; int debug = 0; - char value[2048]; - char path[2048]; + char value[2048] = {}; + char path[2048] = {}; char * the_acl; char * p; SMBCCTX * context;