From 72a8ea4d1545190bad85ee9f2216499e78b3625a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 4 Sep 2010 14:05:59 +1000 Subject: 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 --- source3/lib/util_sid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib') 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; } -- cgit