1
0
Эх сурвалжийг харах

Ticket 47620 - Fix dereferenced NULL pointer in agmtlist_modify_callback()

The server would dereference a NULL point if an attribute was deleted from a replication
agreement.

https://fedorahosted.org/389/ticket/47620

Reviewed by: rmeggins(Thanks!)
Mark Reynolds 12 жил өмнө
parent
commit
8baed897f5

+ 3 - 1
ldap/servers/plugins/replication/repl5_agmtlist.c

@@ -245,7 +245,9 @@ agmtlist_modify_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry
 	for (i = 0; NULL != mods && NULL != mods[i]; i++)
 	{
 		slapi_ch_free_string(&val);
-		val = slapi_berval_get_string_copy (mods[i]->mod_bvalues[0]);
+		if (mods[i]->mod_bvalues && mods[i]->mod_bvalues[0])
+			val = slapi_berval_get_string_copy (mods[i]->mod_bvalues[0]);
+		}
 		if (slapi_attr_types_equivalent(mods[i]->mod_type, type_nsds5ReplicaInitialize))
 		{
             /* we don't allow delete attribute operations unless it was issued by