From 9773f43b11aa8fac51407694bbdcd17830f206d5 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 7 Feb 2017 12:56:35 +0000 Subject: [PATCH] ITS#8585 Fail ldap_result if handle is already bad --- libraries/libldap/result.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index dd3b2b6426..fba8ff4397 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -113,6 +113,9 @@ ldap_result( Debug( LDAP_DEBUG_TRACE, "ldap_result ld %p msgid %d\n", (void *)ld, msgid, 0 ); + if (ld->ld_errno == LDAP_LOCAL_ERROR || ld->ld_errno == LDAP_SERVER_DOWN) + return -1; + LDAP_MUTEX_LOCK( &ld->ld_res_mutex ); rc = wait4msg( ld, msgid, all, timeout, result ); LDAP_MUTEX_UNLOCK( &ld->ld_res_mutex ); -- 2.39.5