Skip to content

Commit a6c7169

Browse files
committed
Allow to add the whole root zones into blacklist. Fixes #564.
1 parent c8c596f commit a6c7169

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/blackwhitelist.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ int blackwhitelist_load_list(const char *filename) {
7070
line);
7171
continue;
7272
}
73-
if (strlen(line) < 3) {
74-
printf("WARNING: host %s is less than 3 bytes, skipping\n", line);
73+
if (strlen(line) < 2) {
74+
printf("WARNING: host %s is less than 2 characters, skipping\n", line);
7575
continue;
7676
}
7777
if (add_hostname(line))
@@ -99,8 +99,7 @@ int blackwhitelist_check_hostname(const char *host_addr, size_t host_len) {
9999

100100
tokenized_host = strchr(current_host, '.');
101101
while (tokenized_host != NULL && tokenized_host < (current_host + HOST_MAXLEN)) {
102-
/* Search hostname only if there is next token */
103-
if (strchr(tokenized_host + 1, '.') && check_get_hostname(tokenized_host + 1))
102+
if (check_get_hostname(tokenized_host + 1))
104103
return TRUE;
105104
tokenized_host = strchr(tokenized_host + 1, '.');
106105
}

0 commit comments

Comments
 (0)