Based on code from Richard Sharpe <realrichardsharpe@gmail.com>,
authorJeremy Allison <jra@samba.org>
Wed, 28 Mar 2012 22:09:47 +0000 (15:09 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 29 Mar 2012 15:53:43 +0000 (08:53 -0700)
ensure we don't crash on a NULL DACL.

source3/smbd/file_access.c

index 9fff8e3051fdc39cd156f87fbceb5ad9006d48a7..6ced6a625587798ffdadb1d92b75a1d88048e679 100644 (file)
@@ -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;
        }