]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
examples: Initialize char arrays
authorAndreas Schneider <asn@samba.org>
Mon, 24 Jun 2024 13:17:13 +0000 (15:17 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 28 Jun 2024 11:39:33 +0000 (11:39 +0000)
"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 <asn@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
examples/libsmbclient/testacl3.c

index e5ec2c88b95b6e5c22a98fc1468fdfd27aac0d2c..2e3ee5d4c3cb0f32e8eee616b0d451810495d9fb 100644 (file)
@@ -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;