X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=servers%2Fslurpd%2Fre.c;h=4e806abc8f7bd542f6b110243e48ed16c675d945;hb=3eb53370201fd41923f82b18226d504aec376362;hp=e0b38c65e31b184d81d07d05a376e7902ff0ebd4;hpb=416aeb9347609866126a71de112afdefdff829bf;p=openldap diff --git a/servers/slurpd/re.c b/servers/slurpd/re.c index e0b38c65e3..4e806abc8f 100644 --- a/servers/slurpd/re.c +++ b/servers/slurpd/re.c @@ -1,10 +1,18 @@ /* $OpenLDAP$ */ -/* - * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. - * COPYING RESTRICTIONS APPLY, see COPYRIGHT file +/* This work is part of OpenLDAP Software . + * + * Copyright 1998-2003 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . */ -/* - * Copyright (c) 1996 Regents of the University of Michigan. +/* Portions Copyright (c) 1996 Regents of the University of Michigan. * All rights reserved. * * Redistribution and use in source and binary forms are permitted @@ -14,6 +22,10 @@ * software without specific prior written permission. This software * is provided ``as is'' without express or implied warranty. */ +/* ACKNOWLEDGEMENTS: + * This work was originally developed by the University of Michigan + * (as part of U-MICH LDAP). + */ /* * re.c - routines which deal with Re (Replication entry) structures. @@ -33,11 +45,11 @@ #include #include +#include "../slapd/slap.h" + #include "slurp.h" #include "globals.h" -#include "../slapd/slap.h" - /* Forward references */ static Rh *get_repl_hosts LDAP_P(( char *, int *, char ** )); static int gettype LDAP_P(( char * )); @@ -583,7 +595,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 ) {