summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-04-07 13:12:05 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-04-09 17:06:41 +0000
commit75cdf654bcc192ba73a8834e507583a59140e7e4 (patch)
tree602253f0aa7884b7e5b4ca952afd0e84d678f31d /src/corelib/kernel/qvariant.cpp
parent07bd5a90a3dccaa31940e3b1a78069f55e25405a (diff)
QMap: fix UB (invalid cast) in QMapData::end()
The end() pointer, like in all other containers, is a sentinel value that must never be dereferenced. But unlike array-based containers, end() in QMap is not "last element plus one", but points to a base class of Node, not a full Node. Therefore, the casting from QMapNodeBase to QMapNode must not be a static_cast, reinterpret_cast is required. libstdc++-v3's red-black tree had the exact same problem: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60734 Change-Id: I43f05fedf0b44314a2dafffd14b33697861ae589 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.cpp')
0 files changed, 0 insertions, 0 deletions