diff options
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 03226d522f..0d60880615 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -2047,29 +2047,32 @@ BOOL samr_io_group_info4(char *desc, GROUP_INFO4 * gr4, reads or writes a structure. ********************************************************************/ -static BOOL samr_group_info_ctr(char *desc, GROUP_INFO_CTR * ctr, +static BOOL samr_group_info_ctr(char *desc, GROUP_INFO_CTR **ctr, prs_struct *ps, int depth) { - if (ctr == NULL) + if (UNMARSHALLING(ps)) + *ctr = (GROUP_INFO_CTR *)prs_alloc_mem(ps,sizeof(GROUP_INFO_CTR)); + + if (*ctr == NULL) return False; prs_debug(ps, depth, desc, "samr_group_info_ctr"); depth++; - if(!prs_uint16("switch_value1", ps, depth, &ctr->switch_value1)) + if(!prs_uint16("switch_value1", ps, depth, &(*ctr)->switch_value1)) return False; - if(!prs_uint16("switch_value2", ps, depth, &ctr->switch_value2)) + if(!prs_uint16("switch_value2", ps, depth, &(*ctr)->switch_value2)) return False; - switch (ctr->switch_value1) { + switch ((*ctr)->switch_value1) { case 1: if(!samr_io_group_info1("group_info1", - &ctr->group.info1, ps, depth)) + &(*ctr)->group.info1, ps, depth)) return False; break; case 4: if(!samr_io_group_info4("group_info4", - &ctr->group.info4, ps, depth)) + &(*ctr)->group.info4, ps, depth)) return False; break; default: @@ -2395,7 +2398,7 @@ BOOL samr_io_q_set_groupinfo(char *desc, SAMR_Q_SET_GROUPINFO * q_e, if(!smb_io_pol_hnd("pol", &q_e->pol, ps, depth)) return False; - if(!samr_group_info_ctr("ctr", q_e->ctr, ps, depth)) + if(!samr_group_info_ctr("ctr", &q_e->ctr, ps, depth)) return False; return True; @@ -2507,7 +2510,7 @@ BOOL samr_io_r_query_groupinfo(char *desc, SAMR_R_QUERY_GROUPINFO * r_u, return False; if (r_u->ptr != 0) { - if(!samr_group_info_ctr("ctr", r_u->ctr, ps, depth)) + if(!samr_group_info_ctr("ctr", &r_u->ctr, ps, depth)) return False; } |