diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 21:14:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 21:14:49 +0000 |
commit | 2f230033794fafdf10822568e763d4db68cf6c6b (patch) | |
tree | 39ca5c2325b7b43c9a28ca6d4ad4026a61e7eb97 /dnscrypt.cc | |
parent | Adding debian version 1.8.3-3. (diff) | |
download | dnsdist-2f230033794fafdf10822568e763d4db68cf6c6b.tar.xz dnsdist-2f230033794fafdf10822568e763d4db68cf6c6b.zip |
Merging upstream version 1.9.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dnscrypt.cc')
-rw-r--r-- | dnscrypt.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/dnscrypt.cc b/dnscrypt.cc index 6db8613..9be46d7 100644 --- a/dnscrypt.cc +++ b/dnscrypt.cc @@ -399,9 +399,10 @@ bool DNSCryptQuery::parsePlaintextQuery(const PacketBuffer& packet) return false; } - const struct dnsheader * dh = reinterpret_cast<const struct dnsheader *>(packet.data()); - if (dh->qr || ntohs(dh->qdcount) != 1 || dh->ancount != 0 || dh->nscount != 0 || dh->opcode != Opcode::Query) + const dnsheader_aligned dh(packet.data()); + if (dh->qr || ntohs(dh->qdcount) != 1 || dh->ancount != 0 || dh->nscount != 0 || static_cast<uint8_t>(dh->opcode) != Opcode::Query) { return false; + } unsigned int qnameWireLength; uint16_t qtype, qclass; @@ -418,7 +419,7 @@ bool DNSCryptQuery::parsePlaintextQuery(const PacketBuffer& packet) return false; } - d_qname = qname; + d_qname = std::move(qname); d_id = dh->id; d_valid = true; |