From ae86b58838fc3cc5978312b61613c10ce7fb6aa0 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Mon, 8 Jul 2019 14:00:28 -0400
Subject: [PATCH 06/12] Issue 50431 - Fix regression from coverity fix
Description: Fix a regression from the initial coverity commit that
caused the memebrOf groupattrs to become corrupted and
crash the server.
https://pagure.io/389-ds-base/issue/50431
Reviewed by: vashirov(Thanks!)
---
ldap/servers/plugins/memberof/memberof_config.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ldap/servers/plugins/memberof/memberof_config.c b/ldap/servers/plugins/memberof/memberof_config.c
index 124217ee0..6729c3a7e 100644
--- a/ldap/servers/plugins/memberof/memberof_config.c
+++ b/ldap/servers/plugins/memberof/memberof_config.c
@@ -550,8 +550,9 @@ memberof_apply_config(Slapi_PBlock *pb __attribute__((unused)),
}
/* Build the new list */
- for (i = 0; theConfig.group_slapiattrs && theConfig.group_slapiattrs[i] &&
- theConfig.groupattrs && theConfig.groupattrs[i]; i++)
+ for (i = 0; theConfig.group_slapiattrs &&
+ theConfig.groupattrs &&
+ theConfig.groupattrs[i]; i++)
{
theConfig.group_slapiattrs[i] = slapi_attr_new();
slapi_attr_init(theConfig.group_slapiattrs[i], theConfig.groupattrs[i]);
--
2.21.0