diff options
author | Jeremy Allison <jra@samba.org> | 2007-04-29 20:57:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:45 -0500 |
commit | 571845991e137eb5f166d54c59a9e7efc1d565af (patch) | |
tree | 04d8095d356ca78eb9c9a887d1e3628261265b42 /source3 | |
parent | 08a730e2ef8df7325f59c288fca9c61b56454642 (diff) | |
download | samba-571845991e137eb5f166d54c59a9e7efc1d565af.tar.gz samba-571845991e137eb5f166d54c59a9e7efc1d565af.tar.bz2 samba-571845991e137eb5f166d54c59a9e7efc1d565af.zip |
r22576: Fix marshalling bug in aliasmem.
Jeremy.
(This used to be commit 415c476f7242269d6feb2365531f4c8286bdc0f2)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 18d1a66e71..9beefbc0c0 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -4834,9 +4834,15 @@ BOOL samr_io_r_query_aliasmem(const char *desc, SAMR_R_QUERY_ALIASMEM * r_u, if(!prs_uint32("num_sids1", ps, depth, &r_u->num_sids1)) return False; - ptr_sid = TALLOC_ARRAY(ps->mem_ctx, uint32, r_u->num_sids1); - if (!ptr_sid) { - return False; + if (UNMARSHALLING(ps)) { + if (r_u->num_sids1) { + ptr_sid = TALLOC_ARRAY(ps->mem_ctx, uint32, r_u->num_sids1); + if (!ptr_sid) { + return False; + } + } else { + ptr_sid = NULL; + } } for (i = 0; i < r_u->num_sids1; i++) { @@ -4846,7 +4852,14 @@ BOOL samr_io_r_query_aliasmem(const char *desc, SAMR_R_QUERY_ALIASMEM * r_u, } if (UNMARSHALLING(ps)) { - r_u->sid = TALLOC_ARRAY(ps->mem_ctx, DOM_SID2, r_u->num_sids1); + if (r_u->num_sids1) { + r_u->sid = TALLOC_ARRAY(ps->mem_ctx, DOM_SID2, r_u->num_sids1); + if (!r_u->sid) { + return False; + } + } else { + r_u->sid = NULL; + } } for (i = 0; i < r_u->num_sids1; i++) { |