aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Hartmann <peter-qt@hartmann.tk>2017-03-15 11:59:14 +0100
committerPeter Hartmann <peter-qt@hartmann.tk>2017-05-09 09:28:19 +0000
commitbd782dea29bf925208b60dccaaa04a931e449aa1 (patch)
treebe500d80a3edd9f111bc85c9ab626e04e0b67e34 /src
parentbabfbe2de2a325f21354febec80def032f2f6865 (diff)
QQmlComponent: Fix heap buffer overflow with bogus input
(cherry picked from commit 30dbe57521c9b1f4cac74db8f5f15a3c466c20d0) Change-Id: I20a030ddba6ae42b9959473fe68e622c6a42a8bf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/parser/qqmljslexer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljslexer.cpp b/src/qml/parser/qqmljslexer.cpp
index 5e8ea049ed..86804f1fa0 100644
--- a/src/qml/parser/qqmljslexer.cpp
+++ b/src/qml/parser/qqmljslexer.cpp
@@ -718,6 +718,11 @@ again:
return multilineStringLiteral ? T_MULTILINE_STRING_LITERAL : T_STRING_LITERAL;
} else if (_char == QLatin1Char('\\')) {
scanChar();
+ if (_codePtr > _endPtr) {
+ _errorCode = IllegalEscapeSequence;
+ _errorMessage = QCoreApplication::translate("QQmlParser", "End of file reached at escape sequence");
+ return T_ERROR;
+ }
QChar u;