From: Bogdan Harjoc Date: Thu, 9 Aug 2018 10:04:52 +0000 (+0300) Subject: evdns: handle NULL filename explicitly X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3e6553a1808989c15b8dd1945b4707b7d35667ad;p=libevent 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) --- diff --git a/evdns.c b/evdns.c index a3f1226a..58209626 100644 --- a/evdns.c +++ b/evdns.c @@ -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. */