summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCœur <coeur@gmx.fr>2023-03-02 13:43:54 +0800
committerAzat Khuzhin <azat@libevent.org>2023-03-02 07:41:08 +0100
commite96e98aea5ed9f69641e74b39153747218990bdc (patch)
treed1891f285c146e6b6143abaf3d509dfc98732697
parent3bcc92cf59cf9bd20d54f13d3a5f0fe51d029e81 (diff)
downloadlibevent-e96e98aea5ed9f69641e74b39153747218990bdc.tar.gz
evdns: fix "Branch condition evaluates to a garbage value" in reply_parse
-rw-r--r--evdns.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/evdns.c b/evdns.c
index 05e515c0..4e8ee21d 100644
--- a/evdns.c
+++ b/evdns.c
@@ -1265,6 +1265,8 @@ reply_parse(struct evdns_base *base, u8 *packet, int length)
struct request *req = NULL;
unsigned int i, buf_size;
+ memset(&reply, 0, sizeof(reply));
+
ASSERT_LOCKED(base);
GET16(trans_id);
@@ -1280,8 +1282,6 @@ reply_parse(struct evdns_base *base, u8 *packet, int length)
if (!req) return -1;
EVUTIL_ASSERT(req->base == base);
- memset(&reply, 0, sizeof(reply));
-
/* If it's not an answer, it doesn't correspond to any request. */
if (!(flags & _QR_MASK)) return -1; /* must be an answer */
if ((flags & (_RCODE_MASK|_TC_MASK)) && (flags & (_RCODE_MASK|_TC_MASK)) != DNS_ERR_NOTEXIST) {