When the UDP response to a DoH query was truncated, we re-send the
query via TCP, passing it to a TCP worker. We need to edit the ID
to its original value before that, and while there is no reason
that the query is smaller than a dnsheader, we need to check its size,
not the size of the response.
continue;
}
- if (!du->tcp && du->truncated && du->response.size() > sizeof(dnsheader)) {
+ if (!du->tcp && du->truncated && du->query.size() > sizeof(dnsheader)) {
/* restoring the original ID */
dnsheader* queryDH = reinterpret_cast<struct dnsheader*>(du->query.data() + du->proxyProtocolPayloadSize);
queryDH->id = du->ids.origID;