summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-09-04 14:10:31 +1000
committerJeremy Allison <jra@samba.org>2010-09-14 14:48:49 -0700
commit46f585e364fc1640cf01ba0c738c6c5559f0b4fd (patch)
tree0e4f9de2bcaf765e3b4e221f31d38cadba4b2c7a /libcli
parent51ecf796549287b7f10092778ffb52e018ae32fe (diff)
downloadsamba-46f585e364fc1640cf01ba0c738c6c5559f0b4fd.tar.gz
samba-46f585e364fc1640cf01ba0c738c6c5559f0b4fd.tar.bz2
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')
-rw-r--r--libcli/security/dom_sid.c10
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;
}