libcli:security: Do not duplicate invalid aces
authorAndreas Schneider <asn@samba.org>
Wed, 12 Dec 2018 09:08:53 +0000 (10:08 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 12 Dec 2018 17:34:11 +0000 (18:34 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
libcli/security/security_descriptor.c

index 0a2bb952b0eb3ec6ae53ad5601adfb87da4e2d80..02c3212fa63f5a57809d94c00dc3ee317f057cd4 100644 (file)
@@ -58,6 +58,10 @@ struct security_acl *security_acl_dup(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
+       if (oacl->aces == NULL && oacl->num_aces > 0) {
+               return NULL;
+       }
+
        nacl = talloc (mem_ctx, struct security_acl);
        if (nacl == NULL) {
                return NULL;