diff options
author | Jeremy Allison <jra@samba.org> | 2007-05-04 22:01:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:54 -0500 |
commit | f1d8c4da23049cf0115666f8d97dac251395de76 (patch) | |
tree | c230d4f8c2b27fefd2e612fb2392388102233111 /source3/rpc_server | |
parent | 32b9beb164a419b97f00811dbc7a0fb57e086690 (diff) | |
download | samba-f1d8c4da23049cf0115666f8d97dac251395de76.tar.gz samba-f1d8c4da23049cf0115666f8d97dac251395de76.tar.bz2 samba-f1d8c4da23049cf0115666f8d97dac251395de76.zip |
r22675: Simo's patch for 0 size allocation. Still need
to examine parse_misc.c fix.
Jeremy.
(This used to be commit 80d981265cd3bc9d73c5da3c514ec736e2dfa73a)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index a85f0548bf..bde1ef81da 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -825,7 +825,11 @@ static NTSTATUS _lsa_lookup_sids_internal(pipes_struct *p, *pp_mapped_count = 0; *pp_ref = NULL; *pp_names = NULL; - + + if (num_sids == 0) { + return NT_STATUS_OK; + } + names = TALLOC_ZERO_P(p->mem_ctx, LSA_TRANS_NAME_ENUM2); sids = TALLOC_ARRAY(p->mem_ctx, const DOM_SID *, num_sids); ref = TALLOC_ZERO_P(p->mem_ctx, DOM_R_REF); @@ -845,12 +849,10 @@ static NTSTATUS _lsa_lookup_sids_internal(pipes_struct *p, return status; } - if (num_sids > 0) { - names->name = TALLOC_ARRAY(names, LSA_TRANS_NAME2, num_sids); - names->uni_name = TALLOC_ARRAY(names, UNISTR2, num_sids); - if ((names->name == NULL) || (names->uni_name == NULL)) { - return NT_STATUS_NO_MEMORY; - } + names->name = TALLOC_ARRAY(names, LSA_TRANS_NAME2, num_sids); + names->uni_name = TALLOC_ARRAY(names, UNISTR2, num_sids); + if ((names->name == NULL) || (names->uni_name == NULL)) { + return NT_STATUS_NO_MEMORY; } for (i=0; i<MAX_REF_DOMAINS; i++) { |