auth/creds/guess: avoid segfault with NULL lp (CID 241187)
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 7 May 2019 00:51:09 +0000 (12:51 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 9 May 2019 22:39:27 +0000 (22:39 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
auth/credentials/credentials.c

index 7ef58d0..befce2c 100644 (file)
@@ -965,7 +965,8 @@ _PUBLIC_ void cli_credentials_guess(struct cli_credentials *cred,
                cli_credentials_parse_password_file(cred, p, CRED_GUESS_FILE);
        }
        
-       if (cli_credentials_get_kerberos_state(cred) != CRED_DONT_USE_KERBEROS) {
+       if (lp_ctx != NULL &&
+           cli_credentials_get_kerberos_state(cred) != CRED_DONT_USE_KERBEROS) {
                cli_credentials_set_ccache(cred, lp_ctx, NULL, CRED_GUESS_FILE,
                                           &error_string);
        }