s3:modules: Initialize mask_permset (CID 1435850)
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Fri, 6 Oct 2023 01:58:34 +0000 (14:58 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 13 Oct 2023 02:18:31 +0000 (02:18 +0000)
If this code had ever run, sys_acl_clear_perms() would have attempted to
write to some random address in memory. ‘mask_permset’ must be a valid
non‐NULL pointer.

Commit 9b79d5f2a2f8af75ef13bdc41d2dc296e19ba098 seems to have been a
previous attempt to fix this issue.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/modules/vfs_fake_acls.c

index 402ac593aae6a54e15885356c40ff8ef9332a0ea..fefe6c5483e388ab802a02dee8d7db90fb9a88dd 100644 (file)
@@ -575,7 +575,8 @@ static int fake_acl_process_chmod(SMB_ACL_T *pp_the_acl,
 
        if (!got_mask) {
                SMB_ACL_ENTRY_T mask_entry;
-               SMB_ACL_PERMSET_T mask_permset;
+               uint32_t mask_perm = 0;
+               SMB_ACL_PERMSET_T mask_permset = &mask_perm;
                ret = sys_acl_create_entry(&the_acl, &mask_entry);
                if (ret == -1) {
                        return -1;