libcli: Fixed a segfault in security_acl_dup when the acl is NULL.
authorBrendan Powers <brendan0powers@gmail.com>
Tue, 25 May 2010 20:14:37 +0000 (16:14 -0400)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 19 Jun 2010 20:20:48 +0000 (22:20 +0200)
This can happen when duplicating a security descriptor that is missing either sacls or dacls.

Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
libcli/security/security_descriptor.c

index b77a28185261b9f1e8353a88e6fda93bab31f64d..4e67e0a96b24c871fc278f16a7e51f1296b213ae 100644 (file)
@@ -55,6 +55,10 @@ struct security_acl *security_acl_dup(TALLOC_CTX *mem_ctx,
 {
        struct security_acl *nacl;
 
+       if (oacl == NULL) {
+               return NULL;
+       }
+
        nacl = talloc (mem_ctx, struct security_acl);
        if (nacl == NULL) {
                return NULL;