Blame SOURCES/0065-Ticket-49291-slapi_search_internal_callback_pb-may-S.patch

61f723
From 28529671057c95327a35c326ee99fcafccad9de9 Mon Sep 17 00:00:00 2001
61f723
From: Thierry Bordaz <tbordaz@redhat.com>
61f723
Date: Wed, 14 Jun 2017 18:36:55 +0200
61f723
Subject: [PATCH] Ticket 49291 - slapi_search_internal_callback_pb may SIGSEV
61f723
 if related pblock has not operation set
61f723
61f723
Bug Description:
61f723
    if slapi_search_internal_set_pb is called with an invalid (NULL) base, the pblock should not
61f723
    be used to call send_ldap_result. If it is, the send_ldap_result trying to derefence the
61f723
    operation pointer will crash
61f723
61f723
Fix Description:
61f723
    Check that the operation is set before derefencing it
61f723
61f723
https://pagure.io/389-ds-base/issue/49291
61f723
61f723
Reviewed by: Mark Reynolds
61f723
61f723
Platforms tested: F23
61f723
61f723
Flag Day: no
61f723
61f723
Doc impact: no
61f723
---
61f723
 ldap/servers/slapd/result.c | 5 +++++
61f723
 1 file changed, 5 insertions(+)
61f723
61f723
diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c
61f723
index 56257c3..f3016ca 100644
61f723
--- a/ldap/servers/slapd/result.c
61f723
+++ b/ldap/servers/slapd/result.c
61f723
@@ -350,6 +350,11 @@ send_ldap_result_ext(
61f723
 	slapi_pblock_get (pb, SLAPI_BIND_METHOD, &bind_method);
61f723
 	slapi_pblock_get (pb, SLAPI_OPERATION, &operation);
61f723
 
61f723
+	if (operation == NULL) {
61f723
+		slapi_log_err(SLAPI_LOG_ERR, "send_ldap_result_ext", "No operation found: slapi_search_internal_set_pb was incomplete (invalid 'base' ?)\n");
61f723
+		return;
61f723
+	}
61f723
+
61f723
 	if (operation->o_status == SLAPI_OP_STATUS_RESULT_SENT) {
61f723
 		return; /* result already sent */
61f723
 	}
61f723
-- 
61f723
2.9.5
61f723