Skip to content

Commit

Permalink
higher.c: don't try to parse comments in hosts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ppaeps authored and wtoorop committed Apr 26, 2016
1 parent e5bc396 commit af380d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions higher.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit af380d7

Please sign in to comment.