summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosapplicationdelegate.mm
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-12-06 23:47:36 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-12-08 18:00:17 +0000
commit0326ea08b1d856b5d879564d8dc4a122ad457575 (patch)
tree49c3535e92c810e9fe192acce124c06b366c1cbd /src/plugins/platforms/ios/qiosapplicationdelegate.mm
parent536e17372803e7c9557e4a59ae8dad0405f11cd2 (diff)
QNetworkRequest: don't assume QByteArray::constData() is NUL-terminated
It isn't guaranteed to be, for QByteArrays originating from QByteArray::fromRawData(). Use the four-arg qstrnicmp() overload (with defaulted fourth argument), wrapped in a lambda to DRY, instead of qstricmp(), which may produce incorrect results or even read past user-supplied buffers. There were also uses of QByteArray::compare(c-literal, Qt::CaseInsensitive). They're not affected by the problem, but QByteArray is scheduled to lose its string-y API parts and become a container of octets in the future. Besides, the lambda solution is much nicer on the eye. Pick-to: 6.4 6.2 5.15 Change-Id: I1e0f9003082f4158edecc6fe8cf3c0518e5403f5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/plugins/platforms/ios/qiosapplicationdelegate.mm')
0 files changed, 0 insertions, 0 deletions