diff options
author | Garming Sam <garming@catalyst.net.nz> | 2013-12-16 16:50:37 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-01-14 23:44:26 +0100 |
commit | 6f4ec0c0416772040903c4c236fb14384c1ded6f (patch) | |
tree | 261dfe0e770aa21104f5dd52e2f8feb25b5bb21a /nsswitch/pam_winbind.c | |
parent | e586e4b50f3b2056abc81f62b8887a88036efd05 (diff) | |
download | samba-6f4ec0c0416772040903c4c236fb14384c1ded6f.tar.gz |
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/pam_winbind.c')
-rw-r--r-- | nsswitch/pam_winbind.c | 6 |
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; } |