diff options
author | Luke Leighton <lkcl@samba.org> | 1999-09-28 20:54:58 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-09-28 20:54:58 +0000 |
commit | 0db243bacb356ce4787c1de7e12832942b55e9e1 (patch) | |
tree | dbf7d1d0c5062c6d3416fdc356d07469cd6f104c /source3/rpc_client | |
parent | 748cccec6696c4d8f99a48953a8c78ce151850f5 (diff) | |
download | samba-0db243bacb356ce4787c1de7e12832942b55e9e1.tar.gz samba-0db243bacb356ce4787c1de7e12832942b55e9e1.tar.bz2 samba-0db243bacb356ce4787c1de7e12832942b55e9e1.zip |
memory problems associated with when lsalookupsids returns
NT_STATUS_NONE_MAPPED.
(This used to be commit 9a43a2551186de02b6cf06a5b84c9591a66c1817)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_lsarpc.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index af00949325..45ec91d37c 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -361,8 +361,23 @@ BOOL lsa_lookup_sids(struct cli_state *cli, uint16 fnum, LSA_Q_LOOKUP_SIDS q_l; BOOL valid_response = False; + ZERO_STRUCT(q_l); + if (hnd == NULL || num_sids == 0 || sids == NULL) return False; + if (num_names != NULL) + { + *num_names = 0; + } + if (types != NULL) + { + *types = NULL; + } + if (names != NULL) + { + *names = NULL; + } + prs_init(&buf , 1024, 4, SAFETY_MARGIN, False); prs_init(&rbuf, 0 , 4, SAFETY_MARGIN, True ); @@ -390,7 +405,9 @@ BOOL lsa_lookup_sids(struct cli_state *cli, uint16 fnum, lsa_io_r_lookup_sids("", &r_l, &rbuf, 0); p = rbuf.offset != 0; - if (p && r_l.status != 0 && r_l.status != 0x107) + if (p && r_l.status != 0 && + r_l.status != 0x107 && + r_l.status != 0xC0000000 | NT_STATUS_NONE_MAPPED) { /* report error code */ DEBUG(1,("LSA_LOOKUP_SIDS: %s\n", get_nt_error_msg(r_l.status))); @@ -423,12 +440,12 @@ BOOL lsa_lookup_sids(struct cli_state *cli, uint16 fnum, } } - if (types != NULL && valid_response && t_names.num_entries != 0) + if (types != NULL && valid_response && (*num_names) != 0) { (*types) = (uint8*)malloc((*num_names) * sizeof(uint8)); } - if (names != NULL && valid_response && t_names.num_entries != 0) + if (names != NULL && valid_response && (*num_names) != 0) { (*names) = (char**)malloc((*num_names) * sizeof(char*)); } |