From 2bd79a0cd026d3fedeb126c023b01f9ee76a81df Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Tue, 7 May 2019 12:51:09 +1200 Subject: [PATCH] auth/creds/guess: avoid segfault with NULL lp (CID 241187) Signed-off-by: Douglas Bagnall Reviewed-by: Gary Lockyer --- auth/credentials/credentials.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); }