From af380d73e27705e0024dc674c35e7097adc26aa1 Mon Sep 17 00:00:00 2001 From: Philip Paeps Date: Mon, 25 Apr 2016 12:25:00 +0530 Subject: [PATCH] higher.c: don't try to parse comments in hosts A '#' in a line in /etc/hosts indicates the beginning of a comment and any further characters until the end of the line should not be parsed. --- higher.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/higher.c b/higher.c index 528283ce..4ca347b4 100644 --- a/higher.c +++ b/higher.c @@ -216,6 +216,9 @@ ldns_get_rr_list_hosts_frm_fp_l(FILE *fp, int *line_nr) } (void)strlcpy(addr, word, LDNS_MAX_LINELEN+1); } else { + /* Stop parsing line when a comment begins. */ + if (word[0] == '#') + break; /* la al la la */ if (ip6) { snprintf(rr_str, LDNS_MAX_LINELEN,