1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

s3:smbd: Make sure struct security_ace is initialized

"Error: UNINIT (CWE-457):
samba-4.20.0rc2/source3/smbd/posix_acls.c:4706: var_decl: Declaring variable ""aces"" without initializer.
samba-4.20.0rc2/source3/smbd/posix_acls.c:4748: uninit_use_in_call: Using uninitialized value ""*aces"". Field ""aces->object"" is uninitialized when calling ""make_sec_acl"".
 4746|   	idx++;
 4747|
 4748|-> 	new_dacl = make_sec_acl(ctx,
 4749|   				NT4_ACL_REVISION,
 4750|   				idx,"

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
This commit is contained in:
Andreas Schneider 2024-06-21 10:49:53 +02:00 committed by Martin Schwenke
parent 321ee914a4
commit aae8cab3f9

View File

@ -4703,7 +4703,7 @@ static NTSTATUS make_default_acl_windows(TALLOC_CTX *ctx,
{
struct dom_sid owner_sid, group_sid;
size_t size = 0;
struct security_ace aces[4];
struct security_ace aces[4] = {0};
uint32_t access_mask = 0;
mode_t mode = psbuf->st_ex_mode;
struct security_acl *new_dacl = NULL;