mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
smb3: fix possible access to uninitialized pointer to DACL
dacl_ptr can be null so we must check for it everywhere it is used in build_sec_desc. Addresses-Coverity: 1475598 ("Explicit null dereference") Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
0917310b98
commit
a5628263a9
1 changed files with 1 additions and 1 deletions
|
@ -1294,7 +1294,7 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
|
|||
ndacl_ptr = (struct cifs_acl *)((char *)pnntsd + ndacloffset);
|
||||
ndacl_ptr->revision =
|
||||
dacloffset ? dacl_ptr->revision : cpu_to_le16(ACL_REVISION);
|
||||
ndacl_ptr->num_aces = dacl_ptr->num_aces;
|
||||
ndacl_ptr->num_aces = dacl_ptr ? dacl_ptr->num_aces : 0;
|
||||
|
||||
if (uid_valid(uid)) { /* chown */
|
||||
uid_t id;
|
||||
|
|
Loading…
Reference in a new issue