ctx->gsh is sometimes NULL here, so dereferencing it without checking is
bad.
--
Stephen Gallagher
RHCE 804006346421761
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
From 705ce4149543550a43c464dda7e48837252dda2c Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgall...@redhat.com>
Date: Thu, 6 May 2010 11:23:23 -0400
Subject: [PATCH 6/6] Fix segfault in GSSAPI reconnect code
---
src/providers/ldap/ldap_id.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c
index c472d8b6439514b027b4627f397777933c79db01..0b2294bd08878bb875a86bd372344aa87547ceb0 100644
--- a/src/providers/ldap/ldap_id.c
+++ b/src/providers/ldap/ldap_id.c
@@ -744,7 +744,9 @@ static void sdap_account_info_users_done(struct tevent_req *req)
ctx = talloc_get_type(breq->be_ctx->bet_info[BET_ID].pvt_bet_data,
struct sdap_id_ctx);
if (sdap_check_gssapi_reconnect(ctx)) {
- ctx->gsh->connected = false;
+ if (ctx->gsh) {
+ ctx->gsh->connected = false;
+ }
err = sdap_account_info_restart(breq);
if (err == EOK) return;
}
@@ -775,7 +777,9 @@ static void sdap_account_info_groups_done(struct tevent_req *req)
ctx = talloc_get_type(breq->be_ctx->bet_info[BET_ID].pvt_bet_data,
struct sdap_id_ctx);
if (sdap_check_gssapi_reconnect(ctx)) {
- ctx->gsh->connected = false;
+ if (ctx->gsh) {
+ ctx->gsh->connected = false;
+ }
err = sdap_account_info_restart(breq);
if (err == EOK) return;
}
@@ -806,7 +810,9 @@ static void sdap_account_info_initgr_done(struct tevent_req *req)
ctx = talloc_get_type(breq->be_ctx->bet_info[BET_ID].pvt_bet_data,
struct sdap_id_ctx);
if (sdap_check_gssapi_reconnect(ctx)) {
- ctx->gsh->connected = false;
+ if (ctx->gsh) {
+ ctx->gsh->connected = false;
+ }
sdap_account_info_restart(breq);
return;
}
--
1.7.0.1
_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel