amoralej / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 years ago
Clone

Blame SOURCES/0070-Ticket-47620-Fix-dereferenced-NULL-pointer-in-agmtli.patch

cc3dff
From 3d941308ae833a59cad81951793b6374a8c15a56 Mon Sep 17 00:00:00 2001
cc3dff
From: Mark Reynolds <mreynolds@redhat.com>
cc3dff
Date: Tue, 17 Dec 2013 13:11:03 -0500
cc3dff
Subject: [PATCH 70/78] Ticket 47620 - Fix dereferenced NULL pointer in
cc3dff
 agmtlist_modify_callback()
cc3dff
cc3dff
The server would dereference a NULL point if an attribute was deleted from a replication
cc3dff
agreement.
cc3dff
cc3dff
https://fedorahosted.org/389/ticket/47620
cc3dff
cc3dff
Reviewed by: rmeggins(Thanks!)
cc3dff
(cherry picked from commit 8baed897f504e75478b5dbbe736c1eaf6d2d7fa9)
cc3dff
(cherry picked from commit 60d263f7bc52e4b5186a01c38868763a275abadc)
cc3dff
---
cc3dff
 ldap/servers/plugins/replication/repl5_agmtlist.c | 4 +++-
cc3dff
 1 file changed, 3 insertions(+), 1 deletion(-)
cc3dff
cc3dff
diff --git a/ldap/servers/plugins/replication/repl5_agmtlist.c b/ldap/servers/plugins/replication/repl5_agmtlist.c
cc3dff
index 5219c92..6e8b82c 100644
cc3dff
--- a/ldap/servers/plugins/replication/repl5_agmtlist.c
cc3dff
+++ b/ldap/servers/plugins/replication/repl5_agmtlist.c
cc3dff
@@ -245,7 +245,9 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
cc3dff
 	for (i = 0; NULL != mods && NULL != mods[i]; i++)
cc3dff
 	{
cc3dff
 		slapi_ch_free_string(&val;;
cc3dff
-		val = slapi_berval_get_string_copy (mods[i]->mod_bvalues[0]);
cc3dff
+		if (mods[i]->mod_bvalues && mods[i]->mod_bvalues[0])
cc3dff
+			val = slapi_berval_get_string_copy (mods[i]->mod_bvalues[0]);
cc3dff
+		}
cc3dff
 		if (slapi_attr_types_equivalent(mods[i]->mod_type, type_nsds5ReplicaInitialize))
cc3dff
 		{
cc3dff
             /* we don't allow delete attribute operations unless it was issued by
cc3dff
-- 
cc3dff
1.8.1.4
cc3dff