From 3e6553a1808989c15b8dd1945b4707b7d35667ad Mon Sep 17 00:00:00 2001 From: Bogdan Harjoc Date: Thu, 9 Aug 2018 13:04:52 +0300 Subject: [PATCH] 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) --- evdns.c | 5 +++++ 1 file changed, 5 insertions(+) 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. */ -- 2.40.0