summaryrefslogtreecommitdiff
path: root/source3/lib/util_sid.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-09-04 14:05:59 +1000
committerJeremy Allison <jra@samba.org>2010-09-14 14:48:49 -0700
commit72a8ea4d1545190bad85ee9f2216499e78b3625a (patch)
tree6dce3794568cabe605225852c2699f97c8b47728 /source3/lib/util_sid.c
parent9d44688681bc196baf1bccbdf84092ffc0510bb7 (diff)
downloadsamba-72a8ea4d1545190bad85ee9f2216499e78b3625a.tar.gz
samba-72a8ea4d1545190bad85ee9f2216499e78b3625a.tar.bz2
samba-72a8ea4d1545190bad85ee9f2216499e78b3625a.zip
s3-util_sid use ARRAY_SIZE() to ensure we never overflow the dom_sid
This ensures that this, unlike the MAXSUBAUTHS macro, can't get out of sync with the structure. Andrew Bartlett
Diffstat (limited to 'source3/lib/util_sid.c')
-rw-r--r--source3/lib/util_sid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index 9a2876baec..1f65f77991 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -293,7 +293,7 @@ format_error:
bool sid_append_rid(struct dom_sid *sid, uint32_t rid)
{
- if (sid->num_auths < MAXSUBAUTHS) {
+ if (sid->num_auths < ARRAY_SIZE(sid->sub_auths)) {
sid->sub_auths[sid->num_auths++] = rid;
return true;
}