1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

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>
This commit is contained in:
Garming Sam 2013-12-16 16:50:37 +13:00 committed by Andrew Bartlett
parent e586e4b50f
commit 6f4ec0c041

View File

@ -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;
}