]> git.sur5r.net Git - openldap/commitdiff
ITS#7144 fix crash replicating modDN if oldRDN not present
authorHoward Chu <hyc@openldap.org>
Thu, 2 Feb 2012 10:53:40 +0000 (02:53 -0800)
committerHoward Chu <hyc@openldap.org>
Thu, 2 Feb 2012 10:53:40 +0000 (02:53 -0800)
servers/slapd/syncrepl.c

index 6acdaf20774797fc63fccb33c7d110d5a4aba8bc..48b315ebb8d780c5720b72c9a07bc07f1e52f60d 100644 (file)
@@ -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,