Skip to content

Commit

Permalink
Fix checking return value of the evdns_base_resolv_conf_parse()
Browse files Browse the repository at this point in the history
Reported-by: Maxim Gorbachyov <[email protected]>
(cherry picked from commit c3f3534)
  • Loading branch information
azat committed Jun 28, 2020
1 parent e0e5f3b commit fc51bf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion evdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -4032,7 +4032,7 @@ evdns_base_new(struct event_base *event_base, int flags)
#else
r = evdns_base_resolv_conf_parse(base, opts, "/etc/resolv.conf");
#endif
if (r == -1) {
if (r) {
evdns_base_free_and_unlock(base, 0);
return NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions sample/dns-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ main(int c, char **v) {
res = evdns_base_resolv_conf_parse(evdns_base,
DNS_OPTION_NAMESERVERS, o.resolv_conf);

if (res < 0) {
fprintf(stderr, "Couldn't configure nameservers");
if (res) {
fprintf(stderr, "Couldn't configure nameservers\n");
return 1;
}
}
Expand Down

4 comments on commit fc51bf2

@olysonek
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FYI, this change slightly broke Transmission:
transmission/transmission#1437

@azat
Copy link
Member Author

@azat azat commented on fc51bf2 Sep 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olysonek thanks for reporting this, however the problem is in transmission code, not libevent itself

@olysonek
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@azat I'm considering temporarily reverting the libevent change downstream in Fedora until Transmission is fixed. Do you see any issues this could cause?

Thanks!

@azat
Copy link
Member Author

@azat azat commented on fc51bf2 Sep 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@azat I'm considering temporarily reverting the libevent change downstream in Fedora until Transmission is fixed. Do you see any issues this could cause?

Feel free to revert it, this should not cause any problems in other places (except for not returning error when it should)

Please sign in to comment.