summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-04-21 16:15:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:18 -0500
commitc271c861804c54e3feea5aff662d5728fbb235f1 (patch)
tree673cd1e7236dcb590e0b705b2f8fbe5537bbaaef /source3/nsswitch
parent0d6acfe19a6bf09305ba9727a4f967199dfa29a1 (diff)
downloadsamba-c271c861804c54e3feea5aff662d5728fbb235f1.tar.gz
samba-c271c861804c54e3feea5aff662d5728fbb235f1.tar.bz2
samba-c271c861804c54e3feea5aff662d5728fbb235f1.zip
r319: Fix a segfault in winbind. Thanks to Guenther Deschner for his valgrind log
:-) Volker (This used to be commit 91296a6003417e8704114ea63511c2c9201da122)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_pam.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c
index a2ebe0ddbc..c5c9ca6322 100644
--- a/source3/nsswitch/winbindd_pam.c
+++ b/source3/nsswitch/winbindd_pam.c
@@ -274,8 +274,12 @@ enum winbindd_result winbindd_pam_auth(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 );