]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpc_client: Initialize struct security_ace
authorAndreas Schneider <asn@samba.org>
Thu, 20 Jun 2024 12:42:54 +0000 (14:42 +0200)
committerMartin Schwenke <martins@samba.org>
Sun, 30 Jun 2024 23:20:33 +0000 (23:20 +0000)
"Error: UNINIT (CWE-457):
samba-4.20.0rc2/source3/rpc_client/init_spoolss.c:348: var_decl: Declaring variable ""ace"" without initializer.
samba-4.20.0rc2/source3/rpc_client/init_spoolss.c:415: uninit_use_in_call: Using uninitialized value ""*ace"". Field ""ace->object"" is uninitialized when calling ""make_sec_acl"".
  413|       NT5 machine. */
  414|
  415|->  if ((psa = make_sec_acl(mem_ctx, NT4_ACL_REVISION, i, ace)) != NULL) {
  416|    psd = make_sec_desc(mem_ctx,
  417|        SD_REVISION,"

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
source3/rpc_client/init_spoolss.c

index c341b82b6ee1f26b3130ec075dc56ff68345d697..a17505f592d92570c6e0e8b2df6a83d0316ef598 100644 (file)
@@ -345,7 +345,7 @@ WERROR spoolss_create_default_devmode(TALLOC_CTX *mem_ctx,
 WERROR spoolss_create_default_secdesc(TALLOC_CTX *mem_ctx,
                                      struct spoolss_security_descriptor **secdesc)
 {
-       struct security_ace ace[7];     /* max number of ace entries */
+       struct security_ace ace[7] = {0};       /* max number of ace entries */
        int i = 0;
        uint32_t sa;
        struct security_acl *psa = NULL;