summaryrefslogtreecommitdiff
path: root/src/corelib/json/qjson.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/json/qjson.cpp')
-rw-r--r--src/corelib/json/qjson.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/json/qjson.cpp b/src/corelib/json/qjson.cpp
index 66078f3cc8..c3b58e59a5 100644
--- a/src/corelib/json/qjson.cpp
+++ b/src/corelib/json/qjson.cpp
@@ -200,6 +200,7 @@ bool Object::isValid() const
if (tableOffset + length*sizeof(offset) > size)
return false;
+ QString lastKey;
for (uint i = 0; i < length; ++i) {
offset entryOffset = table()[i];
if (entryOffset + sizeof(Entry) >= tableOffset)
@@ -208,8 +209,12 @@ bool Object::isValid() const
int s = e->size();
if (table()[i] + s > tableOffset)
return false;
+ QString key = e->key();
+ if (key < lastKey)
+ return false;
if (!e->value.isValid(this))
return false;
+ lastKey = key;
}
return true;
}