summaryrefslogtreecommitdiff
path: root/source3/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
commit3f3f47b0bd8d089120d267cfad1976db95cd8ebe (patch)
tree145ed3a2c31999fa352c123b3a366a96ce4dde62 /source3/lsarpcd
parentbce4d95ca9f0f1b175f5eff682c961754d494253 (diff)
downloadsamba-3f3f47b0bd8d089120d267cfad1976db95cd8ebe.tar.gz
samba-3f3f47b0bd8d089120d267cfad1976db95cd8ebe.tar.bz2
samba-3f3f47b0bd8d089120d267cfad1976db95cd8ebe.zip
added ASSERT() and ASSERT_ARRAY() macros and sprinkled them liberally
in the rpc code. (This used to be commit e6ce1c5b5a9f29d8fcbbd23019186ff5c600e795)
Diffstat (limited to 'source3/lsarpcd')
-rw-r--r--source3/lsarpcd/srv_lsa.c8
1 files changed, 8 insertions, 0 deletions
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++)
{