evdns: handle NULL filename explicitly

Otherwise we will try to open NULL filename and got EFAULT and anyway
will got the same return code from evdns_base_resolv_conf_parse_impl()

Closes: #680 (cherry-picked)
(cherry picked from commit 3e6553a1808989c15b8dd1945b4707b7d35667ad)
This commit is contained in:
Bogdan Harjoc 2018-08-09 13:04:52 +03:00 committed by Azat Khuzhin
parent 6e759975b5
commit 0033f5cc49
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

View File

@ -3623,6 +3623,11 @@ evdns_base_resolv_conf_parse_impl(struct evdns_base *base, int flags, const char
mm_free(fname);
}
if (!filename) {
evdns_resolv_set_defaults(base, flags);
return 1;
}
if ((err = evutil_read_file_(filename, &resolv, &n, 0)) < 0) {
if (err == -1) {
/* No file. */