summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/json/qjsonparser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/json/qjsonparser.cpp b/src/corelib/json/qjsonparser.cpp
index 7989d18901..b151af7955 100644
--- a/src/corelib/json/qjsonparser.cpp
+++ b/src/corelib/json/qjsonparser.cpp
@@ -886,7 +886,8 @@ bool Parser::parseString(bool *latin1)
return false;
}
}
- if (ch > 0xff) {
+ // bail out if the string is not pure latin1 or too long to hold as a latin1string (which has only 16 bit for the length)
+ if (ch > 0xff || json - start >= 0x8000) {
*latin1 = false;
break;
}