From 9ef785082af0cf4ff94fae4bd0154f745dcdce30 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 2 Jul 2024 11:04:26 +0200 Subject: [PATCH] tst_QtConcurrentThreadEngine: fix UB (uninitialized boolean) Says ubsan: tst_qtconcurrentthreadengine.cpp:96:17: runtime error: load of value 190, which is not a valid value for type 'bool' PASS : tst_QtConcurrentThreadEngine::stresstest() Initialize the variable using NSDMI. Amends the start of the public history. Reported-by: Even Oscar Andersen Pick-to: 6.7 6.5 6.2 5.15 Task-number: QTBUG-115264 Change-Id: Ie55bc0a697a71074066294d64821c8a7a0d1f467 Reviewed-by: Ivan Solovev Reviewed-by: Even Oscar Andersen (cherry picked from commit 32442c2b52381f5e4164ae217453a8e8391d9349) Reviewed-by: Qt Cherry-pick Bot --- .../qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp index 0151b13693d..1749fb5eac2 100644 --- a/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp +++ b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp @@ -106,7 +106,7 @@ public: { return 0; } - bool done; + bool done = false; }; void tst_QtConcurrentThreadEngine::runThroughStarter()