diff --git a/0031-QML-Fortify-qmlExecuteDeferred-some-more.patch b/0031-QML-Fortify-qmlExecuteDeferred-some-more.patch new file mode 100644 index 0000000..f46d758 --- /dev/null +++ b/0031-QML-Fortify-qmlExecuteDeferred-some-more.patch @@ -0,0 +1,54 @@ +From 453b1cb207cf3ce35b906c21c9f04a17d66074a7 Mon Sep 17 00:00:00 2001 +From: Ulf Hermann +Date: Wed, 8 Feb 2023 12:14:21 +0100 +Subject: [PATCH 31/31] QML: Fortify qmlExecuteDeferred some more + +I don't know how to trigger this, but a recent crash report from the CI +shows that we can get there without a valid engine. + +Pick-to: 6.5 +Change-Id: I9f17894da82b8e7eab88181c96dfa8eaf7795523 +Reviewed-by: Fabian Kosmale +(cherry picked from commit f69b6f0940b178b46ecbaa5f0b4956ac44e8379e) +--- + src/qml/qml/qqmlengine.cpp | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp +index d6b2711c2d..5f3367e4d2 100644 +--- a/src/qml/qml/qqmlengine.cpp ++++ b/src/qml/qml/qqmlengine.cpp +@@ -1588,17 +1588,22 @@ void qmlExecuteDeferred(QObject *object) + { + QQmlData *data = QQmlData::get(object); + +- if (data && !data->deferredData.isEmpty() && !data->wasDeleted(object)) { +- QQmlEnginePrivate *ep = QQmlEnginePrivate::get(data->context->engine); ++ if (!data ++ || !data->context ++ || !data->context->engine ++ || data->deferredData.isEmpty() ++ || data->wasDeleted(object)) { ++ return; ++ } + +- QQmlComponentPrivate::DeferredState state; +- QQmlComponentPrivate::beginDeferred(ep, object, &state); ++ QQmlEnginePrivate *ep = QQmlEnginePrivate::get(data->context->engine); ++ QQmlComponentPrivate::DeferredState state; ++ QQmlComponentPrivate::beginDeferred(ep, object, &state); + +- // Release the reference for the deferral action (we still have one from construction) +- data->releaseDeferredData(); ++ // Release the reference for the deferral action (we still have one from construction) ++ data->releaseDeferredData(); + +- QQmlComponentPrivate::completeDeferred(ep, &state); +- } ++ QQmlComponentPrivate::completeDeferred(ep, &state); + } + + QQmlContext *qmlContext(const QObject *obj) +-- +2.41.0 + diff --git a/qt5-qtdeclarative.spec b/qt5-qtdeclarative.spec index 6274a13..13d200c 100644 --- a/qt5-qtdeclarative.spec +++ b/qt5-qtdeclarative.spec @@ -12,7 +12,7 @@ Summary: Qt5 - QtDeclarative component Name: qt5-%{qt_module} Version: 5.15.11 -Release: 1%{?dist} +Release: 2%{?dist} # See LICENSE.GPL LICENSE.LGPL LGPL_EXCEPTION.txt, for details License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0 @@ -58,7 +58,7 @@ Patch27: 0027-QRecyclePool-fix-potential-UB.patch Patch28: 0028-QtQml-Clean-up-QQmlData-ctor.patch Patch29: 0029-QML-Make-notify-list-thread-safe.patch Patch30: 0030-Flickable-prevent-fixup-from-being-called-while-drag.patch - +Patch31: 0031-QML-Fortify-qmlExecuteDeferred-some-more.patch ## upstreamable patches Patch100: %{name}-gcc11.patch @@ -241,6 +241,9 @@ make check -k -C tests ||: %changelog +* Mon Oct 30 2023 Jan Grulich - 5.15.11-2 +- Upstream backport: QML: Fortify qmlExecuteDeferred some more + * Fri Oct 06 2023 Jan Grulich - 5.15.11-1 - 5.15.11