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

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