]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#2320, check for NULL re->re_replicas
authorHoward Chu <hyc@openldap.org>
Fri, 21 Feb 2003 02:14:46 +0000 (02:14 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 21 Feb 2003 02:14:46 +0000 (02:14 +0000)
servers/slurpd/re.c

index d93a1682a4bab50ea29d4fee7fe85e03d1d8b6b1..1100396a8707b279c5ecdc320a397779ca778141 100644 (file)
@@ -583,7 +583,7 @@ Re_write(
            goto bad;
        }
     } else {                   /* write multiple "replica:" lines */
-       for ( i = 0; re->re_replicas[ i ].rh_hostname != NULL; i++ ) {
+       for ( i = 0; re->re_replicas && re->re_replicas[ i ].rh_hostname != NULL; i++ ) {
            if ( fprintf( fp, "replica: %s:%d\n",
                    re->re_replicas[ i ].rh_hostname,
                    re->re_replicas[ i ].rh_port ) < 0 ) {