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

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