summaryrefslogtreecommitdiffstats
path: root/src/corelib/json/qjsonparser_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/json/qjsonparser_p.h')
-rw-r--r--src/corelib/json/qjsonparser_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/json/qjsonparser_p.h b/src/corelib/json/qjsonparser_p.h
index e3b95109c6..afa2c1a8cf 100644
--- a/src/corelib/json/qjsonparser_p.h
+++ b/src/corelib/json/qjsonparser_p.h
@@ -109,6 +109,10 @@ private:
if (current + space >= dataLength) {
dataLength = 2*dataLength + space;
data = (char *)realloc(data, dataLength);
+ if (!data) {
+ lastError = QJsonParseError::DocumentTooLarge;
+ return -1;
+ }
}
int pos = current;
current += space;