diff --git a/doc/Changelog b/doc/Changelog index 794f1140b..85e043d4a 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,7 @@ - 0.9 released. - 1.0 development. Printout ldns version on unbound -h. - start of perf tool. + - bugfix to read empty lines from /etc/hosts. 12 February 2008: Wouter - fixup problem with configure calling itself if ldns-src tarball diff --git a/libunbound/libunbound.c b/libunbound/libunbound.c index 2b694dac1..0e7d70256 100644 --- a/libunbound/libunbound.c +++ b/libunbound/libunbound.c @@ -878,6 +878,8 @@ ub_ctx_hosts(struct ub_ctx* ctx, char* fname) /* skip addr */ while(isxdigit(*parse) || *parse == '.' || *parse == ':') parse++; + if(*parse == '\n' || *parse == 0) + continue; if(*parse != ' ' && *parse != '\t') { /* must have whitespace after address */ fclose(in);