Blame SOURCES/0075-Issue-49188-retrocl-can-crash-server-at-shutdown.patch

b7d5c1
From c101544797e0b563bc0955934a74a4dc25a5b467 Mon Sep 17 00:00:00 2001
b7d5c1
From: Mark Reynolds <mreynolds@redhat.com>
b7d5c1
Date: Wed, 22 Mar 2017 10:18:13 -0400
b7d5c1
Subject: [PATCH] Issue 49188 - retrocl can crash server at shutdown
b7d5c1
b7d5c1
Description:  We do not calloc enough elements when processing nsslapd-attribute
b7d5c1
              from the retrocl plugin configuration.  This causes invalid memory
b7d5c1
              to be freed at shutdown(via slapi_ch_array_free).
b7d5c1
b7d5c1
https://pagure.io/389-ds-base/issue/49188
b7d5c1
b7d5c1
Reviewed by: mreynolds(one line commit rule)
b7d5c1
b7d5c1
(cherry picked from commit b2f76abe10bfbe621308410a1e7f41287cf2ff9e)
b7d5c1
---
b7d5c1
 ldap/servers/plugins/retrocl/retrocl.c | 4 ++--
b7d5c1
 1 file changed, 2 insertions(+), 2 deletions(-)
b7d5c1
b7d5c1
diff --git a/ldap/servers/plugins/retrocl/retrocl.c b/ldap/servers/plugins/retrocl/retrocl.c
b7d5c1
index 0b336d5..6167e88 100644
b7d5c1
--- a/ldap/servers/plugins/retrocl/retrocl.c
b7d5c1
+++ b/ldap/servers/plugins/retrocl/retrocl.c
b7d5c1
@@ -468,8 +468,8 @@ static int retrocl_start (Slapi_PBlock *pb)
b7d5c1
 
b7d5c1
         retrocl_nattributes = n;
b7d5c1
 
b7d5c1
-        retrocl_attributes = (char **)slapi_ch_calloc(n, sizeof(char *));
b7d5c1
-        retrocl_aliases = (char **)slapi_ch_calloc(n, sizeof(char *));
b7d5c1
+        retrocl_attributes = (char **)slapi_ch_calloc(n + 1, sizeof(char *));
b7d5c1
+        retrocl_aliases = (char **)slapi_ch_calloc(n + 1, sizeof(char *));
b7d5c1
 
b7d5c1
         slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "Attributes:\n");
b7d5c1
 
b7d5c1
-- 
b7d5c1
2.9.3
b7d5c1