From 3f3f47b0bd8d089120d267cfad1976db95cd8ebe Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Aug 1998 02:54:21 +0000 Subject: added ASSERT() and ASSERT_ARRAY() macros and sprinkled them liberally in the rpc code. (This used to be commit e6ce1c5b5a9f29d8fcbbd23019186ff5c600e795) --- source3/lsarpcd/srv_lsa.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/lsarpcd') diff --git a/source3/lsarpcd/srv_lsa.c b/source3/lsarpcd/srv_lsa.c index da0c11ea7b..d2ca2d7a76 100644 --- a/source3/lsarpcd/srv_lsa.c +++ b/source3/lsarpcd/srv_lsa.c @@ -163,6 +163,8 @@ static void make_reply_lookup_rids(LSA_R_LOOKUP_RIDS *r_l, r_l->undoc_buffer = 1; r_l->num_entries2 = num_entries; + ASSERT_ARRAY(r_l->dom_rid, num_entries); + for (i = 0; i < num_entries; i++) { make_dom_rid2(&(r_l->dom_rid[i]), dom_rids[i]); @@ -182,6 +184,8 @@ static void make_lsa_trans_names(LSA_TRANS_NAME_ENUM *trn, int i; (*total) = 0; + ASSERT(num_entries <= MAX_LOOKUP_SIDS); + for (i = 0; i < num_entries; i++) { uint32 rid = 0xffffffff; @@ -192,6 +196,8 @@ static void make_lsa_trans_names(LSA_TRANS_NAME_ENUM *trn, trn->ptr_name[i] = 0; trn->ptr_name[(*total)] = 0; + ASSERT_ARRAY(sid[i].sid.sub_auths, num_auths); + /* find the rid to look up */ if (num_auths != 0) { @@ -397,6 +403,8 @@ static void api_lsa_lookup_names( int uid, prs_struct *data, string_to_sid(&sid_S_1_3, "S-1-3"); string_to_sid(&sid_S_1_5, "S-1-5"); + ASSERT_ARRAY(q_l.lookup_name, q_l.num_entries); + /* convert received RIDs to strings, so we can do them. */ for (i = 0; i < q_l.num_entries; i++) { -- cgit