summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2024-05-09 14:52:20 -0700
committerThiago Macieira <thiago.macieira@intel.com>2024-05-10 13:17:20 -0700
commite3f520e621a9ea631d8a1d2f9bfc7a5f20dc698a (patch)
tree6ec974536092dbd05b685f4725c43d371a88127e /src
parent1961d42a3d559721d11145109ea7f246415f8405 (diff)
QDnsLookup/Unix: fix off-by-one error in parsing the reply
Found this when the DNS server replied with no errors, no answers, and no EDNS0 tail. Amends eb51454b907b02aa67268c162896fc6778920e4c Pick-to: 6.7 Change-Id: Ie30a3caf09ef4176bb36fffd17cdf0916ac31545 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/network/kernel/qdnslookup_unix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/kernel/qdnslookup_unix.cpp b/src/network/kernel/qdnslookup_unix.cpp
index 2c29eb8c0b..9de073b781 100644
--- a/src/network/kernel/qdnslookup_unix.cpp
+++ b/src/network/kernel/qdnslookup_unix.cpp
@@ -310,7 +310,7 @@ void QDnsLookupRunnable::query(QDnsLookupReply *reply)
expandHost(offset);
if (status < 0)
return;
- if (offset + status + 4 >= responseLength)
+ if (offset + status + 4 > responseLength)
header->qdcount = 0xffff; // invalid reply below
else
offset += status + 4;