mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Fix a crash when reading badly formatted resolve.conf; from Yasuoka Masahiko
This commit is contained in:
parent
e1ffbb82e3
commit
6c7c5799a4
3
evdns.c
3
evdns.c
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user