diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-09-04 14:10:31 +1000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2010-09-14 14:48:49 -0700 |
commit | 46f585e364fc1640cf01ba0c738c6c5559f0b4fd (patch) | |
tree | 0e4f9de2bcaf765e3b4e221f31d38cadba4b2c7a /libcli/security/dom_sid.c | |
parent | 51ecf796549287b7f10092778ffb52e018ae32fe (diff) | |
download | samba-46f585e364fc1640cf01ba0c738c6c5559f0b4fd.tar.gz samba-46f585e364fc1640cf01ba0c738c6c5559f0b4fd.tar.xz samba-46f585e364fc1640cf01ba0c738c6c5559f0b4fd.zip |
libcli/security Use sid_append_rid() in dom_sid_append_rid()
This ensures that the maximum number of sub-authorities is respected,
otherwise we may run off the end of the array.
Andrew Bartlett
Diffstat (limited to 'libcli/security/dom_sid.c')
-rw-r--r-- | libcli/security/dom_sid.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libcli/security/dom_sid.c b/libcli/security/dom_sid.c index f044733316..373f4ae175 100644 --- a/libcli/security/dom_sid.c +++ b/libcli/security/dom_sid.c @@ -272,13 +272,13 @@ struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx, { struct dom_sid *sid; - sid = talloc(mem_ctx, struct dom_sid); + sid = dom_sid_dup(mem_ctx, domain_sid); if (!sid) return NULL; - *sid = *domain_sid; - - sid->sub_auths[sid->num_auths] = rid; - sid->num_auths++; + if (!sid_append_rid(sid, rid)) { + talloc_free(sid); + return NULL; + } return sid; } |