From: Douglas Bagnall Date: Tue, 7 May 2019 00:51:09 +0000 (+1200) Subject: auth/creds/guess: avoid segfault with NULL lp (CID 241187) X-Git-Tag: tdb-1.4.1~127 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2bd79a0cd026d3fedeb126c023b01f9ee76a81df;p=thirdparty%2Fsamba.git auth/creds/guess: avoid segfault with NULL lp (CID 241187) Signed-off-by: Douglas Bagnall Reviewed-by: Gary Lockyer --- diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c index 7ef58d0752c..befce2c2119 100644 --- a/auth/credentials/credentials.c +++ b/auth/credentials/credentials.c @@ -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); }