summaryrefslogtreecommitdiffstats
path: root/src/corelib/json/qjsondocument.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-05-12 12:09:35 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-16 04:25:11 +0200
commit1756a84756807a9849aa507e77845dfdf31b8020 (patch)
tree0ed4ff43ba687440a6a2c2a52da183f752465f51 /src/corelib/json/qjsondocument.h
parentd5000e82e3d17532b76d5a69fd35ac4e8f3b9d18 (diff)
Limit the nesting depth of the Json parser
The parser is recursive and too deeply nested json would cause it to exhaust the available stack space leading to crashes. We now abort parsing with a DeepNesting parse error if the document is too deeply nested. The current nesting limit is set to 1024, which should be more then enough for any real JSON data set. Change-Id: I4adea3fd727149f7342536d73cf4530361a0a3a1 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src/corelib/json/qjsondocument.h')
-rw-r--r--src/corelib/json/qjsondocument.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/json/qjsondocument.h b/src/corelib/json/qjsondocument.h
index c67899192c..bdb171c3cb 100644
--- a/src/corelib/json/qjsondocument.h
+++ b/src/corelib/json/qjsondocument.h
@@ -68,7 +68,8 @@ struct Q_CORE_EXPORT QJsonParseError
IllegalEscapeSequence,
IllegalUTF8String,
UnterminatedString,
- MissingObject
+ MissingObject,
+ DeepNesting
};
QString errorString() const;