From d506e25faa783b080670225bc9a6d62fc32289e1 Mon Sep 17 00:00:00 2001 From: dtucker Date: Wed, 30 Jun 2004 10:34:31 +0000 Subject: [PATCH] - (dtucker) [auth-pam.c] Check for buggy PAM modules that return a NULL appdata_ptr to the conversation function. ok djm@ By rights we should free the messages too, but if this happens then one of the modules has already proven itself to be buggy so can we trust the messages? --- ChangeLog | 4 ++++ auth-pam.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8489e343..3bcf2478 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20040630 + - (dtucker) [auth-pam.c] Check for buggy PAM modules that return a NULL + appdata_ptr to the conversation function. ok djm@ + 20040627 - (tim) update README files. - (dtucker) [mdoc2man.awk] Bug #883: correctly recognise .Pa and .Ev macros. diff --git a/auth-pam.c b/auth-pam.c index 0d433539..5d8fcded 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -275,6 +275,10 @@ sshpam_thread_conv(int n, const struct pam_message **msg, debug3("PAM: %s entering, %d messages", __func__, n); *resp = NULL; + if (data == NULL) { + error("PAM: conversation function passed a null context"); + return (PAM_CONV_ERR); + } ctxt = data; if (n <= 0 || n > PAM_MAX_NUM_MSG) return (PAM_CONV_ERR); -- 2.45.2