Skip to content

Commit

Permalink
evdns: handle NULL filename explicitly
Browse files Browse the repository at this point in the history
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: libevent#680 (cherry-picked)
  • Loading branch information
bharjoc-bitdefender authored and azat committed Oct 21, 2018
1 parent fb090aa commit 3e6553a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions evdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 3e6553a

Please sign in to comment.