diff options
author | Jędrzej Nowacki <jedrzej.nowacki@nokia.com> | 2012-03-08 15:56:33 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-11 22:04:21 +0100 |
commit | e3429f764b37c3d58faf06c6e1856e66fb8d64b9 (patch) | |
tree | b04e08ead1d97214e3c5d992511095773a3fd19f /src | |
parent | e9ed5853f4c5600691d2f369e26a1a7881f9750f (diff) |
Crash fix in QMetaType::typeFlags.
The function is public, so it should validate input instead of crashing
Change-Id: Id67463b0b61ab74a76c1ede7f052bdbed37822b6
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qmetatype.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 0be813f4f2..5032cf9590 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -1616,7 +1616,7 @@ private: static quint32 customTypeFlags(const int type) { const QVector<QCustomTypeInfo> * const ct = customTypes(); - if (Q_UNLIKELY(!ct)) + if (Q_UNLIKELY(!ct || type < QMetaType::User)) return 0; QReadLocker locker(customTypesLock()); if (Q_UNLIKELY(ct->count() <= type - QMetaType::User)) |