From bd57a78a21df89e9a597bd9cd78232f62e617676 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 23 Apr 2004 01:20:23 +0000 Subject: [PATCH] r333: other half of fix for winbindd crask from gd@suse.de --- source/nsswitch/winbindd_pam.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/nsswitch/winbindd_pam.c b/source/nsswitch/winbindd_pam.c index c5c9ca63226..c1840b60533 100644 --- a/source/nsswitch/winbindd_pam.c +++ b/source/nsswitch/winbindd_pam.c @@ -71,7 +71,7 @@ static NTSTATUS check_info3_in_group(TALLOC_CTX *mem_ctx, } if (!string_to_sid(&required_membership_sid, group_sid)) { - DEBUG(0, ("winbindd_pam_auth: could not parse %s as a SID!", + DEBUG(0, ("check_info3_in_group: could not parse %s as a SID!", group_sid)); return NT_STATUS_INVALID_PARAMETER; @@ -530,8 +530,12 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state) } while ( (attempts < 2) && retry ); - clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), &ret_creds); - + if (cli != NULL) { + /* We might have come out of the loop above with cli == NULL, + so don't dereference that. */ + clnt_deal_with_creds(cli->sess_key, &(cli->clnt_cred), &ret_creds); + } + if (NT_STATUS_IS_OK(result)) { netsamlogon_cache_store( cli->mem_ctx, &info3 ); wcache_invalidate_samlogon(find_domain_from_name(name_domain), &info3); -- 2.11.4.GIT