diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-05-15 08:07:32 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-05-16 11:46:40 -0700 |
commit | eb51454b907b02aa67268c162896fc6778920e4c (patch) | |
tree | ac0d4ef60599a2676d661b29aba4f67a6ff83453 /src/network/kernel/qdnslookup_win.cpp | |
parent | 7ca633d9a82f90e5bba5e12ba923bfb0a257af63 (diff) | |
download | qtbase-eb51454b907b02aa67268c162896fc6778920e4c.tar.gz |
QDnsLookup/Unix: rework the buffer-size check code
This is neater with a simple offset and avoids the potential UB code this
was carrying in:
p += size;
(p < response + responseLength)
It's UB to add to a pointer a size that moves it past the end of its
array. In practice we don't expect this to happen because of
construction (p is always pointing to a heap or auxiliary-thread stack
buffer), but in theory it could happen that said buffer is too close to
the end of the virtual address space and adding `size` causes it to
overflow back to small values.
Change-Id: I5f7f427ded124479baa6fffd175f59939c15c666
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network/kernel/qdnslookup_win.cpp')
0 files changed, 0 insertions, 0 deletions