[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] check for errors from evdns_base_resolv_conf_parse() is not correct
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] check for errors from evdns_base_resolv_conf_parse() is not correct
- From: Maxim Gorbachyov <maxim.gorbachyov@xxxxxxxxx>
- Date: Wed, 4 Sep 2019 16:14:33 +0300
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Wed, 04 Sep 2019 09:14:48 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=lT8KdPIQANluy11RgOnwBh3/WC40VDh+xK4cioZ+iJ0=; b=j8gv1G8I8Z8UxKHi6DO/F8c1d5GD8T40d+AM7s91Lq/4JLhbMxTnmj1jvfemMSKMVp gv8NMaJ6S3C9K9VSInqC5zCNF+8QuSekH9kuuTDSXG/4E3H7kvV/Dy0TxEoPcGiPRYid M9JTuSAdX7T5IZ+bS9d4CVMbkeb3QDi/u9KekpzeOS/FINvhY0GUzzO55ZbSltVjc564 hUrwuZcdO1/k/vlryS70/LupltMagqM5406BsKZfCM3Oyj/KuqRJ/78Q6OSEjz/VLL/N WLVTr5FGdVZZezvG5wmxN975mtSmRkE/qKva4JuvvTnPg7kuYE5lnoeAFO+Da4LcaQrG H0Qg==
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Hello.
It seems libevent check for errors from evdns_base_resolv_conf_parse()
is not correct:
evdns_base_resolv_conf_parse() returns positive error codes as described here:
http://www.wangafu.net/~nickm/libevent-2.1/doxygen/html/dns_8h.html#a7e3a053e25ae7c045944a5db0947babb
Implementation:
https://github.com/libevent/libevent/blob/194a5d822651c03fc988c1bf087e65ed20f453f7/evdns.c#L3660
But callers check for "-1":
https://github.com/libevent/libevent/blob/194a5d822651c03fc988c1bf087e65ed20f453f7/evdns.c#L4035
or for negative int:
https://github.com/libevent/libevent/blob/194a5d822651c03fc988c1bf087e65ed20f453f7/sample/dns-example.c#L228
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.