https://fedorahosted.org/freeipa/ticket/5977


>From e84b475fd863b3dff0af6bcf3b2cb3840bcca1e6 Mon Sep 17 00:00:00 2001
From: root <r...@vm-058-107.abc.idm.lab.eng.brq.redhat.com>
Date: Wed, 22 Jun 2016 16:36:15 +0200
Subject: [PATCH] Topology plugins sigsev/heap corruption when adding a managed
 host

A managed host may handle several ipaReplTopoManagedSuffix.
Removing (from the topology) such host, loops over the replicated
suffixes array to retrieve, in the hosts list, the host record and delete it.
The problem is that a variable used to manage a hosts list is not reset
when looking at the next suffix. That will messup the lists, keeping
freed elements in the lists.

The fix is to reset the variable inside the replicated suffix loop

https://fedorahosted.org/freeipa/ticket/5977
---
 daemons/ipa-slapi-plugins/topology/topology_cfg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/daemons/ipa-slapi-plugins/topology/topology_cfg.c b/daemons/ipa-slapi-plugins/topology/topology_cfg.c
index 23b8edd..a99a2d0 100644
--- a/daemons/ipa-slapi-plugins/topology/topology_cfg.c
+++ b/daemons/ipa-slapi-plugins/topology/topology_cfg.c
@@ -528,6 +528,7 @@ ipa_topo_cfg_host_del(Slapi_Entry *hostentry)
 
         slapi_lock_mutex(replica->repl_lock);
         hostnode = replica->hosts;
+        prevnode = NULL;
         while (hostnode) {
             if (!strcasecmp(hostnode->hostname,delhost)) {
                 /*remove from list and free*/
-- 
2.5.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to