From: Philip Paeps Date: Mon, 25 Apr 2016 06:55:00 +0000 (+0530) Subject: higher.c: don't try to parse comments in hosts X-Git-Tag: release-1.7.0-rc1~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af380d73e27705e0024dc674c35e7097adc26aa1;p=thirdparty%2Fldns.git 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. --- 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,