From: Howard Chu Date: Thu, 2 Feb 2012 10:53:40 +0000 (-0800) Subject: ITS#7144 fix crash replicating modDN if oldRDN not present X-Git-Tag: OPENLDAP_REL_ENG_2_4_29~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ff40a2a47a6ba5d37f840ffdbebc771a38d80cbd;p=openldap ITS#7144 fix crash replicating modDN if oldRDN not present --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 6acdaf2077..48b315ebb8 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -4135,7 +4135,10 @@ dn_callback( dni->oldDesc = ad; for ( oldpos=0, a=rs->sr_entry->e_attrs; a && a->a_desc != ad; oldpos++, a=a->a_next ); - dni->oldNcount = a->a_numvals; + /* a should not be NULL but apparently it happens. + * ITS#7144 + */ + dni->oldNcount = a ? a->a_numvals : 0; for ( newpos=0, a=dni->new_entry->e_attrs; a && a->a_desc != ad; newpos++, a=a->a_next ); if ( !a || oldpos != newpos || attr_valfind( a,