aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/compiler/qv4compileddata.cpp2
-rw-r--r--tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/data/fuzzed.1.qml2
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp2
4 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 8f2f4a11c1..9fb91e9140 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -897,6 +897,8 @@ bool ResolvedTypeReference::addToHash(QCryptographicHash *hash, QQmlEngine *engi
hash->addData(createPropertyCache(engine)->checksum(&ok));
return ok;
}
+ if (!compilationUnit)
+ return false;
hash->addData(compilationUnit->unitData()->md5Checksum, sizeof(compilationUnit->unitData()->md5Checksum));
return true;
}
diff --git a/tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt b/tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt
new file mode 100644
index 0000000000..e399799fe9
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt
@@ -0,0 +1,2 @@
+2:8:Cannot assign to non-existent property "_G"
+
diff --git a/tests/auto/qml/qqmllanguage/data/fuzzed.1.qml b/tests/auto/qml/qqmllanguage/data/fuzzed.1.qml
new file mode 100644
index 0000000000..f80b9c3a2d
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/fuzzed.1.qml
@@ -0,0 +1,2 @@
+import QtQuick 2.4
+Item { _G.G.G:G }
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index f7198415a2..10af8d70e8 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -613,6 +613,8 @@ void tst_qqmllanguage::errors_data()
QTest::newRow("badCompositeRegistration.1") << "badCompositeRegistration.1.qml" << "badCompositeRegistration.1.errors.txt" << false;
QTest::newRow("badCompositeRegistration.2") << "badCompositeRegistration.2.qml" << "badCompositeRegistration.2.errors.txt" << false;
QTest::newRow("cyclicAlias") << "cyclicAlias.qml" << "cyclicAlias.errors.txt" << false;
+
+ QTest::newRow("fuzzed.1") << "fuzzed.1.qml" << "fuzzed.1.errors.txt" << false;
}