aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-06-01 15:57:24 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-06-04 22:45:23 +0200
commitbacc90098a3537e1621bc3deea222975b990368a (patch)
treeb12446a05d752e9ed149d0cbaa02a88c66485aad /src
parentf722440659f266eaa32344aa14289cf1da6538cc (diff)
QQmlJS: Import: fix UB (uninitialized read)
Found by UBSAN: qqmljsimporter_p.h:122:12: runtime error: load of value 4, which is not a valid value for type 'bool' qqmljsimporter.cpp:412:20: runtime error: load of value 4, which is not a valid value for type 'bool' Fix by explicitly initializing the bools in Import. This is what adjacent classes do, and in line what the users apparently expect. Amends 687609f2f3a98ade4b8e074615c3d1db1228fce0. Change-Id: I143be1a8d239bbe8c6f00be554b5b678238de91f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qmlcompiler/qqmljsimporter_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qmlcompiler/qqmljsimporter_p.h b/src/qmlcompiler/qqmljsimporter_p.h
index b823e0403d..68a3c30f17 100644
--- a/src/qmlcompiler/qqmljsimporter_p.h
+++ b/src/qmlcompiler/qqmljsimporter_p.h
@@ -121,8 +121,8 @@ private:
struct Import {
QString name;
- bool isStaticModule;
- bool isSystemModule;
+ bool isStaticModule = false;
+ bool isSystemModule = false;
QHash<QString, QQmlJSExportedScope> objects;
QHash<QString, QQmlJSExportedScope> scripts;