summaryrefslogtreecommitdiffstats
path: root/nsswitch
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2013-12-16 16:50:37 +1300
committerAndrew Bartlett <abartlet@samba.org>2014-01-14 23:44:26 +0100
commit6f4ec0c0416772040903c4c236fb14384c1ded6f (patch)
tree261dfe0e770aa21104f5dd52e2f8feb25b5bb21a /nsswitch
parente586e4b50f3b2056abc81f62b8887a88036efd05 (diff)
downloadsamba-6f4ec0c0416772040903c4c236fb14384c1ded6f.tar.gz
samba-6f4ec0c0416772040903c4c236fb14384c1ded6f.tar.xz
samba-6f4ec0c0416772040903c4c236fb14384c1ded6f.zip
pam_winbind: Fix segfault caused by invalid configuration options
This is a better fix for 8564 and will allow ec0f51b200d6e5b99bbd872e169621c17f33524c to be reverted. BUG: https://bugzilla.samba.org/show_bug.cgi?id=8564 Pair-programmed-with: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/pam_winbind.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index cd5e7ba206e..9a5367ba2e2 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -140,7 +140,7 @@ static const char *_pam_error_code_str(int err)
#define _PAM_LOG_FUNCTION_LEAVE(function, ctx, retval) \
do { \
_pam_log_debug(ctx, LOG_DEBUG, "[pamh: %p] LEAVE: " \
- function " returning %d (%s)", ctx->pamh, retval, \
+ function " returning %d (%s)", ctx ? ctx->pamh : NULL, retval, \
_pam_error_code_str(retval)); \
_pam_log_state(ctx); \
} while (0)
@@ -261,7 +261,7 @@ static void _pam_log_debug(struct pwb_context *r, int err, const char *format, .
{
va_list args;
- if (!_pam_log_is_debug_enabled(r->ctrl)) {
+ if (!r || !_pam_log_is_debug_enabled(r->ctrl)) {
return;
}
@@ -348,7 +348,7 @@ static char *iniparser_getstring_nonempty(dictionary *d, char *key, char *def)
static void _pam_log_state(struct pwb_context *ctx)
{
- if (!_pam_log_is_debug_state_enabled(ctx->ctrl)) {
+ if (!ctx || !_pam_log_is_debug_state_enabled(ctx->ctrl)) {
return;
}