summaryrefslogtreecommitdiffstats
path: root/source/lsarpcd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-22 02:54:21 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-22 02:54:21 +0000
commite6ce1c5b5a9f29d8fcbbd23019186ff5c600e795 (patch)
treeb0c833b4bf82f6c71b4da2b216671599bdeb4be7 /source/lsarpcd
parentbd9290c36c9993a994e485da0a81df926f8662e4 (diff)
downloadsamba-e6ce1c5b5a9f29d8fcbbd23019186ff5c600e795.tar.gz
samba-e6ce1c5b5a9f29d8fcbbd23019186ff5c600e795.tar.xz
samba-e6ce1c5b5a9f29d8fcbbd23019186ff5c600e795.zip
added ASSERT() and ASSERT_ARRAY() macros and sprinkled them liberally
in the rpc code.
Diffstat (limited to 'source/lsarpcd')
-rw-r--r--source/lsarpcd/srv_lsa.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/lsarpcd/srv_lsa.c b/source/lsarpcd/srv_lsa.c
index da0c11ea7bf..d2ca2d7a76a 100644
--- a/source/lsarpcd/srv_lsa.c
+++ b/source/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++)
{