From c30aa741ee9fd1ba26bacf4fad98c004897ac3e5 Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Fri, 6 Oct 2023 14:58:34 +1300 Subject: [PATCH] s3:modules: Initialize mask_permset (CID 1435850) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Andrew Bartlett --- source3/modules/vfs_fake_acls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source3/modules/vfs_fake_acls.c b/source3/modules/vfs_fake_acls.c index 402ac593aae..fefe6c5483e 100644 --- a/source3/modules/vfs_fake_acls.c +++ b/source3/modules/vfs_fake_acls.c @@ -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; -- 2.47.3