diff options
author | Cœur <coeur@gmx.fr> | 2023-03-02 13:43:54 +0800 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2023-03-02 07:41:08 +0100 |
commit | e96e98aea5ed9f69641e74b39153747218990bdc (patch) | |
tree | d1891f285c146e6b6143abaf3d509dfc98732697 | |
parent | 3bcc92cf59cf9bd20d54f13d3a5f0fe51d029e81 (diff) | |
download | libevent-e96e98aea5ed9f69641e74b39153747218990bdc.tar.gz |
evdns: fix "Branch condition evaluates to a garbage value" in reply_parse
-rw-r--r-- | evdns.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) { |