summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libsmb/clientgen.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index c510302301..b1d8f8aa73 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -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) {