diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-12-14 14:14:50 +0100 |
---|---|---|
committer | Eric Lemanissier <eric.lemanissier@gmail.com> | 2018-10-08 16:18:53 +0000 |
commit | 8e5a2f63c3f6ee49d3f2e1985bf73de7769b0e72 (patch) | |
tree | 5bd800e1e3a842af8cb9e54a4d7be3f5927a9342 /src/3rdparty | |
parent | 55d640483c1100d9340418c3fb96390087f5e7c4 (diff) |
Fix UB (invalid pointer comparison) in QList, QVector, QVLA
QList, QVector and QVarLengthArray check the validity of iterators
passed to member functions using isValidIterator(), which checks that
the underlying pointers are in the range [begin, end]. This check is
well-defined when the outcome is positive, ie. when the iterator is
valid. But if the iterator is not valid, and does not happen to point
into [end, begin + capacity], the comparison, which uses normal
operator<, invokes UB.
Fix by using std::less<T*>, which defines a total ordering.
Change-Id: I1e5757789b4b9779f5e3e298e7f2b2dd0b27576c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/3rdparty')
0 files changed, 0 insertions, 0 deletions