From 4c774220a752bf8e3284984890dc0931fe73165d Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Mon, 19 Oct 2020 14:03:41 +0100
Subject: [PATCH] ITS#9370 check for equality rule on old_rdn

Just skip normalization if there's no equality rule. We accept
DNs without equality rules already.

Signed-off-by: guoxiaoqi <guoxiaoqi2@huawei.com>
---
 servers/slapd/modrdn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c
index c73dd8d..a229755 100644
--- a/servers/slapd/modrdn.c
+++ b/servers/slapd/modrdn.c
@@ -505,7 +505,7 @@ slap_modrdn2mods(
 			mod_tmp->sml_values = ( BerVarray )ch_malloc( 2 * sizeof( struct berval ) );
 			ber_dupbv( &mod_tmp->sml_values[0], &old_rdn[d_cnt]->la_value );
 			mod_tmp->sml_values[1].bv_val = NULL;
-			if( desc->ad_type->sat_equality->smr_normalize) {
+			if( desc->ad_type->sat_equality && desc->ad_type->sat_equality->smr_normalize) {
 				mod_tmp->sml_nvalues = ( BerVarray )ch_malloc( 2 * sizeof( struct berval ) );
 				(void) (*desc->ad_type->sat_equality->smr_normalize)(
 					SLAP_MR_EQUALITY|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
-- 
1.8.3.1

