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

74ca47
From 8f908a1de1906a0b7451505d9640e2fd2f9fa7eb 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
 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
74ca47
index 32b30c7..6e68667 100644
b7d5c1
--- a/ldap/servers/plugins/retrocl/retrocl.c
b7d5c1
+++ b/ldap/servers/plugins/retrocl/retrocl.c
74ca47
@@ -470,8 +470,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
 
74ca47
         slapi_log_err(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "retrocl_start - Attributes:\n");
b7d5c1
 
b7d5c1
-- 
b7d5c1
2.9.3
b7d5c1