summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-03-28 15:09:47 -0700
committerJeremy Allison <jra@samba.org>2012-03-29 08:53:43 -0700
commit762928945d8c18abbce1447fb0e731a4515ffb4c (patch)
tree47717726eefec8368c30d43e9bb9fb2dc22d51f2 /source3/smbd
parented43a5a94f79b5d2ecbc7ab700b1fd3f96c48ac7 (diff)
downloadsamba-762928945d8c18abbce1447fb0e731a4515ffb4c.tar.gz
samba-762928945d8c18abbce1447fb0e731a4515ffb4c.tar.bz2
samba-762928945d8c18abbce1447fb0e731a4515ffb4c.zip
Based on code from Richard Sharpe <realrichardsharpe@gmail.com>,
ensure we don't crash on a NULL DACL.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/file_access.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c
index 9fff8e3051..6ced6a6255 100644
--- a/source3/smbd/file_access.c
+++ b/source3/smbd/file_access.c
@@ -155,7 +155,10 @@ bool directory_has_default_acl(connection_struct *conn, const char *fname)
NTSTATUS status = SMB_VFS_GET_NT_ACL(conn, fname,
SECINFO_DACL, &secdesc);
- if (!NT_STATUS_IS_OK(status) || secdesc == NULL) {
+ if (!NT_STATUS_IS_OK(status) ||
+ secdesc == NULL ||
+ secdesc->dacl == NULL) {
+ TALLOC_FREE(secdesc);
return false;
}