summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.h1
-rw-r--r--src/corelib/serialization/qjson.cpp8
-rw-r--r--src/corelib/serialization/qjson_p.h2
-rw-r--r--src/corelib/serialization/qjsondocument.cpp3
-rw-r--r--src/corelib/tools/qsimd_p.h5
5 files changed, 10 insertions, 9 deletions
diff --git a/src/corelib/kernel/qabstracteventdispatcher.h b/src/corelib/kernel/qabstracteventdispatcher.h
index 4775d3d47a..bd8da5c35d 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.h
+++ b/src/corelib/kernel/qabstracteventdispatcher.h
@@ -87,6 +87,7 @@ public:
QT_DEPRECATED inline void registerTimer(int timerId, int interval, QObject *object)
{ registerTimer(timerId, interval, Qt::CoarseTimer, object); }
#endif
+ // ### Qt6: change interval range to qint64 (or use QDeadlineTimer)
int registerTimer(int interval, Qt::TimerType timerType, QObject *object);
virtual void registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object) = 0;
virtual bool unregisterTimer(int timerId) = 0;
diff --git a/src/corelib/serialization/qjson.cpp b/src/corelib/serialization/qjson.cpp
index e4bca3bcd0..592f6168dc 100644
--- a/src/corelib/serialization/qjson.cpp
+++ b/src/corelib/serialization/qjson.cpp
@@ -328,7 +328,7 @@ int Value::usedStorage(const Base *b) const
bool Value::isValid(const Base *b) const
{
- int offset = 0;
+ int offset = -1;
switch (type) {
case QJsonValue::Double:
if (latinOrIntValue)
@@ -345,14 +345,12 @@ bool Value::isValid(const Base *b) const
break;
}
- if (!offset)
+ if (offset == -1)
return true;
- if (offset + sizeof(uint) > b->tableOffset)
+ if (offset + sizeof(uint) > b->tableOffset || offset < (int)sizeof(Base))
return false;
int s = usedStorage(b);
- if (!s)
- return true;
if (s < 0 || s > (int)b->tableOffset - offset)
return false;
if (type == QJsonValue::Array)
diff --git a/src/corelib/serialization/qjson_p.h b/src/corelib/serialization/qjson_p.h
index 7743382806..dc56a49084 100644
--- a/src/corelib/serialization/qjson_p.h
+++ b/src/corelib/serialization/qjson_p.h
@@ -450,7 +450,7 @@ static inline void copyString(char *dest, const QString &str, bool compress)
/*
- Base is the base class for both Object and Array. Both classe work more or less the same way.
+ Base is the base class for both Object and Array. Both classes work more or less the same way.
The class starts with a header (defined by the struct below), then followed by data (the data for
values in the Array case and Entry's (see below) for objects.
diff --git a/src/corelib/serialization/qjsondocument.cpp b/src/corelib/serialization/qjsondocument.cpp
index 9794bca60d..ab27b45fda 100644
--- a/src/corelib/serialization/qjsondocument.cpp
+++ b/src/corelib/serialization/qjsondocument.cpp
@@ -210,6 +210,9 @@ QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidat
return QJsonDocument();
}
+ if (size < (int)(sizeof(QJsonPrivate::Header) + sizeof(QJsonPrivate::Base)))
+ return QJsonDocument();
+
QJsonPrivate::Data *d = new QJsonPrivate::Data((char *)data, size);
d->ownsData = false;
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index eb56b31348..18684caefb 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -219,9 +219,8 @@
// AVX intrinsics
# if defined(__AVX__) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC))
// AES, PCLMULQDQ instructions:
-// All processors that support AVX support AES, PCLMULQDQ
-// (but neither MSVC nor the Intel compiler define these macros)
-# define __AES__ 1
+// All processors that support AVX support PCLMULQDQ
+// (but neither MSVC nor the Intel compiler define this macro)
# define __PCLMUL__ 1
# endif