summaryrefslogtreecommitdiff
path: root/source3/libsmb/clierror.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libsmb/clierror.c')
-rw-r--r--source3/libsmb/clierror.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/libsmb/clierror.c b/source3/libsmb/clierror.c
index 89550d18ed..13ea6b1997 100644
--- a/source3/libsmb/clierror.c
+++ b/source3/libsmb/clierror.c
@@ -80,6 +80,11 @@ char *cli_errstr(struct cli_state *cli)
uint8 errclass;
int i;
+ if (!cli->initialised) {
+ fstrcpy(cli_error_message, "[Programmer's error] cli_errstr called on unitialized cli_stat struct!\n");
+ return cli_error_message;
+ }
+
/* Case #1: RAP error */
if (cli->rap_error) {
for (i = 0; rap_errmap[i].message != NULL; i++) {