Fix ITS#2320, check for NULL re->re_replicas

This commit is contained in:
Howard Chu 2003-02-21 02:14:46 +00:00
parent 13b63911a4
commit 9c701c8861

View 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 ) {