aboutsummaryrefslogtreecommitdiff
path: root/libunbound/libunbound.c
diff options
context:
space:
mode:
Diffstat (limited to 'libunbound/libunbound.c')
-rw-r--r--libunbound/libunbound.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libunbound/libunbound.c b/libunbound/libunbound.c
index 91a663a773cb..b3a4c2ba77f6 100644
--- a/libunbound/libunbound.c
+++ b/libunbound/libunbound.c
@@ -61,7 +61,7 @@
#include "services/localzone.h"
#include "services/cache/infra.h"
#include "services/cache/rrset.h"
-#include "ldns/sbuffer.h"
+#include "sldns/sbuffer.h"
#ifdef HAVE_PTHREAD
#include <signal.h>
#endif
@@ -1028,7 +1028,6 @@ ub_ctx_hosts(struct ub_ctx* ctx, const char* fname)
"\\hosts");
retval=ub_ctx_hosts(ctx, buf);
}
- free(name);
return retval;
}
return UB_READFILE;
@@ -1053,6 +1052,8 @@ ub_ctx_hosts(struct ub_ctx* ctx, const char* fname)
/* skip addr */
while(isxdigit((unsigned char)*parse) || *parse == '.' || *parse == ':')
parse++;
+ if(*parse == '\r')
+ parse++;
if(*parse == '\n' || *parse == 0)
continue;
if(*parse == '%')
@@ -1066,7 +1067,8 @@ ub_ctx_hosts(struct ub_ctx* ctx, const char* fname)
*parse++ = 0; /* end delimiter for addr ... */
/* go to names and add them */
while(*parse) {
- while(*parse == ' ' || *parse == '\t' || *parse=='\n')
+ while(*parse == ' ' || *parse == '\t' || *parse=='\n'
+ || *parse=='\r')
parse++;
if(*parse == 0 || *parse == '#')
break;