X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslurpd%2Fconfig.c;h=e9b5d7e7c1600fd75602cdc0c7973e64a35520db;hb=f3384af67ed3a8ced2145dddcc999f61cdc504ce;hp=7c97aaaac850a4fa016e61ddc0d8351c185536b8;hpb=2a869f5a99f537b246ba8640502e2a86117cb6e8;p=openldap diff --git a/servers/slurpd/config.c b/servers/slurpd/config.c index 7c97aaaac8..e9b5d7e7c1 100644 --- a/servers/slurpd/config.c +++ b/servers/slurpd/config.c @@ -19,8 +19,10 @@ #include +#include #include #include +#include #include #include @@ -53,8 +55,7 @@ slurpd_read_config( ) { FILE *fp; - char buf[BUFSIZ]; - char *line, *p; + char *line; int cargc; char *cargv[MAXARGS]; @@ -172,11 +173,13 @@ strtok_quote( } else { inquote = 1; } - strcpy( next, next + 1 ); + SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1 ); break; case '\\': - strcpy( next, next + 1 ); + if ( next[1] ) + SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1 ); + next++; /* dont parse the escaped character */ break; default: @@ -227,7 +230,7 @@ getline( *p = '\0'; } lineno++; - if ( ! isspace( buf[0] ) ) { + if ( ! isspace( (unsigned char) buf[0] ) ) { return( line ); } @@ -338,7 +341,7 @@ parse_replica_line( ri->ri_port = atoi( hp ); } if ( ri->ri_port <= 0 ) { - ri->ri_port = LDAP_PORT; + ri->ri_port = 0; } ri->ri_hostname = strdup( val ); gots |= GOT_HOST;