git.samba.org
/
anatoliy
/
anatoliy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51ecf79
)
libcli/security Use sid_append_rid() in dom_sid_append_rid()
author
Andrew Bartlett
<abartlet@samba.org>
Sat, 4 Sep 2010 04:10:31 +0000
(14:10 +1000)
committer
Jeremy Allison
<jra@samba.org>
Tue, 14 Sep 2010 21:48:49 +0000
(14:48 -0700)
This ensures that the maximum number of sub-authorities is respected,
otherwise we may run off the end of the array.
Andrew Bartlett
libcli/security/dom_sid.c
patch
|
blob
|
history
diff --git
a/libcli/security/dom_sid.c
b/libcli/security/dom_sid.c
index f0447333168614ee7f7e7d4fa67f5255d9f83c0e..373f4ae17560f5c79c1635d62ea99dd666cfc1b1 100644
(file)
--- 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;
}