diff options
author | Nadezhda Ivanova <nadezhda.ivanova@postpath.com> | 2009-09-24 18:29:57 -0700 |
---|---|---|
committer | Nadezhda Ivanova <nadezhda.ivanova@postpath.com> | 2009-09-24 18:54:14 -0700 |
commit | df0d629f3726daf71beaa5ec07b284b865adc000 (patch) | |
tree | 1202aa700c9d7e4a1b67436b813c150f53221c77 /source4/libcli | |
parent | 60433b154dc345f8883b15d657e3f7d5c21fc6a1 (diff) | |
download | samba-df0d629f3726daf71beaa5ec07b284b865adc000.tar.gz samba-df0d629f3726daf71beaa5ec07b284b865adc000.tar.bz2 samba-df0d629f3726daf71beaa5ec07b284b865adc000.zip |
Fixed a dereferenced null pointer.
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/security/create_descriptor.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/source4/libcli/security/create_descriptor.c b/source4/libcli/security/create_descriptor.c index 1054479f28..ebf07ac0fd 100644 --- a/source4/libcli/security/create_descriptor.c +++ b/source4/libcli/security/create_descriptor.c @@ -102,9 +102,13 @@ static bool contains_inheritable_aces(struct security_acl *acl) static struct security_acl *preprocess_creator_acl(TALLOC_CTX *mem, struct security_acl *acl) { int i; - struct security_acl *new_acl = talloc_zero(mem, struct security_acl); + struct security_acl *new_acl; + if (!acl) { + return NULL; + } + + new_acl = talloc_zero(mem, struct security_acl); - new_acl->revision = acl->revision; for (i=0; i < acl->num_aces; i++) { struct security_ace *ace = &acl->aces[i]; if (!(ace->flags & SEC_ACE_FLAG_INHERITED_ACE)){ @@ -369,20 +373,14 @@ static bool compute_acl(int acl_type, goto final; } else{ - if (!c_acl){ - if (acl_type == SEC_DESC_DACL_PRESENT && token->default_dacl) - *new_acl = security_acl_dup(new_sd, token->default_dacl); - } - else{ - *new_acl = preprocess_creator_acl(new_sd,c_acl); - if (*new_acl == NULL) - goto final; - if (!postprocess_acl(*new_acl, new_sd->owner_sid, - new_sd->group_sid,generic_map)) - return false; - else - goto final; - } + *new_acl = preprocess_creator_acl(new_sd,c_acl); + if (*new_acl == NULL) + goto final; + if (!postprocess_acl(*new_acl, new_sd->owner_sid, + new_sd->group_sid,generic_map)) + return false; + else + goto final; } final: if (acl_type == SEC_DESC_DACL_PRESENT && new_sd->dacl) |