Fix a crash when reading badly formatted resolve.conf; from Yasuoka Masahiko

This commit is contained in:
Yasuoka Masahiko 2009-12-04 10:44:46 -08:00 committed by Niels Provos
parent e1ffbb82e3
commit 6c7c5799a4

View File

@ -3304,7 +3304,8 @@ resolv_conf_parse_line(struct evdns_base *base, char *const start, int flags) {
if (!strcmp(first_token, "nameserver") && (flags & DNS_OPTION_NAMESERVERS)) {
const char *const nameserver = NEXT_TOKEN;
evdns_base_nameserver_ip_add(base, nameserver);
if (nameserver)
evdns_base_nameserver_ip_add(base, nameserver);
} else if (!strcmp(first_token, "domain") && (flags & DNS_OPTION_SEARCH)) {
const char *const domain = NEXT_TOKEN;
if (domain) {