]> git.ipfire.org Git - thirdparty/samba.git/commit
s3:lib: Make sure struct security_ace is fully initialized
authorAndreas Schneider <asn@samba.org>
Tue, 18 Jun 2024 13:48:38 +0000 (15:48 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 24 Jun 2024 06:14:35 +0000 (06:14 +0000)
commitc709cb8a17cb1d441c598b9e894f55a3f16bd6df
treed97eefb7d2f8fd616f78f35bd0395a53e87b0cde
parentd6a7a97bc23642d269306eaf20afec11958adfd2
s3:lib: Make sure struct security_ace is fully initialized

Found by Covscan.

"Error: UNINIT (CWE-457):
samba-4.20.0rc2/source3/lib/sharesec.c:275: var_decl: Declaring variable ""ace"" without initializer.
samba-4.20.0rc2/source3/lib/sharesec.c:285: uninit_use_in_call: Using uninitialized value ""ace"". Field ""ace.object"" is uninitialized when calling ""make_sec_acl"".
  283|    init_sec_ace(&ace, &global_sid_World, SEC_ACE_TYPE_ACCESS_ALLOWED, sa, 0);
  284|
  285|->  if ((psa = make_sec_acl(ctx, NT4_ACL_REVISION, 1, &ace)) != NULL) {
  286|    psd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
  287|        SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL,"

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