]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
examples: Initialize char arrays
authorAndreas Schneider <asn@samba.org>
Fri, 28 Jun 2024 12:36:59 +0000 (14:36 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 8 Jul 2024 07:36:33 +0000 (07:36 +0000)
"Error: UNINIT (CWE-457):
samba-4.20.0rc2/examples/libsmbclient/testacl.c:35: var_decl: Declaring variable ""value"" without initializer.
samba-4.20.0rc2/examples/libsmbclient/testacl.c:254: 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.]
  252|    }
  253|
  254|->  printf(""Attributes for [%s] are:\n%s\n"", path, value);
  255|
  256|    if (stat_and_retry)"

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
examples/libsmbclient/testacl.c

index e0e4eeb24d0676b4969556c06d8df77366f675dd..89d766d50642db183522e9b78d5cd0af6c3cf1db 100644 (file)
@@ -31,8 +31,8 @@ int main(int argc, const char *argv[])
        int ret;
        char *p;
        const char *debugstr;
-       char path[1024];
-       char value[1024];
+       char path[1024] = {};
+       char value[1024] = {};
        poptContext pc;
        struct stat st;
        struct poptOption long_options[] =