mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
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:
parent
6e759975b5
commit
0033f5cc49
5
evdns.c
5
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. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user