summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_samr.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-05-22 20:20:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:22:43 -0500
commit71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a (patch)
tree873d148c4731b4d909d3bc1f50ddab49f5849182 /source3/rpc_parse/parse_samr.c
parent725e90f1572be8734c321a3d638abdf778038349 (diff)
downloadsamba-71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a.tar.gz
samba-71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a.tar.bz2
samba-71ee55f98d87ff70e5feb0d2b280e9c71f7b9b6a.zip
r23080: Fix bug #4637 - we hads missed some cases where
we were calling PRS_ALLOC_MEM with zero count. Jeremy. (This used to be commit 9a10736e6fa276ca4b0726fbb7baf0daafbdc46d)
Diffstat (limited to 'source3/rpc_parse/parse_samr.c')
-rw-r--r--source3/rpc_parse/parse_samr.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c
index 223ce86977..e7726fbb26 100644
--- a/source3/rpc_parse/parse_samr.c
+++ b/source3/rpc_parse/parse_samr.c
@@ -3398,7 +3398,7 @@ BOOL samr_io_r_enum_domains(const char *desc, SAMR_R_ENUM_DOMAINS * r_u,
if(!prs_uint32("num_entries3", ps, depth, &r_u->num_entries3))
return False;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && r_u->num_entries2) {
r_u->sam = PRS_ALLOC_MEM(ps,SAM_ENTRY,r_u->num_entries2);
r_u->uni_dom_name = PRS_ALLOC_MEM(ps,UNISTR2,r_u->num_entries2);
}
@@ -3537,7 +3537,7 @@ BOOL samr_io_r_enum_dom_groups(const char *desc, SAMR_R_ENUM_DOM_GROUPS * r_u,
if(!prs_uint32("num_entries3", ps, depth, &r_u->num_entries3))
return False;
- if (UNMARSHALLING(ps)) {
+ if (UNMARSHALLING(ps) && r_u->num_entries2) {
r_u->sam = PRS_ALLOC_MEM(ps,SAM_ENTRY,r_u->num_entries2);
r_u->uni_grp_name = PRS_ALLOC_MEM(ps,UNISTR2,r_u->num_entries2);
}
@@ -5067,12 +5067,13 @@ BOOL samr_io_r_lookup_names(const char *desc, SAMR_R_LOOKUP_NAMES * r_u,
return False;
}
- if (UNMARSHALLING(ps))
+ if (UNMARSHALLING(ps) && r_u->num_rids2) {
r_u->rids = PRS_ALLOC_MEM(ps, uint32, r_u->num_rids2);
- if (!r_u->rids) {
- DEBUG(0, ("NULL rids in samr_io_r_lookup_names\n"));
- return False;
+ if (!r_u->rids) {
+ DEBUG(0, ("NULL rids in samr_io_r_lookup_names\n"));
+ return False;
+ }
}
for (i = 0; i < r_u->num_rids2; i++) {
@@ -5096,12 +5097,13 @@ BOOL samr_io_r_lookup_names(const char *desc, SAMR_R_LOOKUP_NAMES * r_u,
return False;
}
- if (UNMARSHALLING(ps))
+ if (UNMARSHALLING(ps) && r_u->num_types2) {
r_u->types = PRS_ALLOC_MEM(ps, uint32, r_u->num_types2);
- if (!r_u->types) {
- DEBUG(0, ("NULL types in samr_io_r_lookup_names\n"));
- return False;
+ if (!r_u->types) {
+ DEBUG(0, ("NULL types in samr_io_r_lookup_names\n"));
+ return False;
+ }
}
for (i = 0; i < r_u->num_types2; i++) {