1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

Defensive programming for cli_error().

Jeremy.
(This used to be commit 94ed74d5b09d6f28b47b2855c4e4a1dc5c2108d3)
This commit is contained in:
Jeremy Allison 2000-02-09 14:45:22 +00:00
parent 94d68eb808
commit 2768aecae6

View File

@ -2685,12 +2685,18 @@ void cli_shutdown(struct cli_state *cli)
****************************************************************************/
int cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num, uint32 *nt_rpc_error)
{
int flgs2 = SVAL(cli->inbuf,smb_flg2);
int flgs2;
char rcls;
int code;
if (eclass) *eclass = 0;
if (num ) *num = 0;
if (nt_rpc_error) *nt_rpc_error = 0;
if(!cli || !cli->initialised || !cli->inbuf)
return EINVAL;
flgs2 = SVAL(cli->inbuf,smb_flg2);
if (nt_rpc_error) *nt_rpc_error = cli->nt_error;
if (flgs2 & FLAGS2_32_BIT_ERROR_CODES) {