diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2021-01-07 16:23:57 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2021-01-07 17:30:32 +0100 |
commit | df09d077cf4b5361c6d9e8c7da213cb46206e4a5 (patch) | |
tree | 40fbe5b19ccbc5da14e9281a0c2b971368dc0fe5 /dev-qt/qtwayland | |
parent | app-emulation/vice: Version bump to 3.5 (diff) | |
download | gentoo-df09d077cf4b5361c6d9e8c7da213cb46206e4a5.tar.gz gentoo-df09d077cf4b5361c6d9e8c7da213cb46206e4a5.tar.bz2 gentoo-df09d077cf4b5361c6d9e8c7da213cb46206e4a5.zip |
dev-qt/qtwayland: Scanner: Avoid dangling pointers in destroy_func()
See also: https://mail.kde.org/pipermail/plasma-devel/2021-January/119115.html
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'dev-qt/qtwayland')
-rw-r--r-- | dev-qt/qtwayland/files/qtwayland-5.15.2-qtwaylandscanner-avoid-dangling-pointers.patch | 35 | ||||
-rw-r--r-- | dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild | 41 |
2 files changed, 76 insertions, 0 deletions
diff --git a/dev-qt/qtwayland/files/qtwayland-5.15.2-qtwaylandscanner-avoid-dangling-pointers.patch b/dev-qt/qtwayland/files/qtwayland-5.15.2-qtwaylandscanner-avoid-dangling-pointers.patch new file mode 100644 index 000000000000..0799cb1a2023 --- /dev/null +++ b/dev-qt/qtwayland/files/qtwayland-5.15.2-qtwaylandscanner-avoid-dangling-pointers.patch @@ -0,0 +1,35 @@ +From 735164b5c2a2637a8d53a8803a2401e4ef477ff0 Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii <vlad.zahorodnii@kde.org> +Date: Fri, 30 Oct 2020 16:55:30 +0200 +Subject: [PATCH] Scanner: Avoid accessing dangling pointers in destroy_func() + +Usually, the object associated with the resource gets destroyed in the +destroy_resource() function. + +Therefore, we need to double-check that the object is still alive before +trying to reset its m_resource. + +Pick-to: 5.15 +Change-Id: I26408228f58919db17eb29584a1cbd4a9427d25c +Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> +--- + src/qtwaylandscanner/qtwaylandscanner.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/qtwaylandscanner/qtwaylandscanner.cpp b/src/qtwaylandscanner/qtwaylandscanner.cpp +index 1a1f8bf16..450ef519d 100644 +--- a/src/qtwaylandscanner/qtwaylandscanner.cpp ++++ b/src/qtwaylandscanner/qtwaylandscanner.cpp +@@ -814,7 +814,9 @@ bool Scanner::process() + printf(" if (Q_LIKELY(that)) {\n"); + printf(" that->m_resource_map.remove(resource->client(), resource);\n"); + printf(" that->%s_destroy_resource(resource);\n", interfaceNameStripped); +- printf(" if (that->m_resource == resource)\n"); ++ printf("\n"); ++ printf(" that = resource->%s_object;\n", interfaceNameStripped); ++ printf(" if (that && that->m_resource == resource)\n"); + printf(" that->m_resource = nullptr;\n"); + printf(" }\n"); + printf(" delete resource;\n"); +-- +2.16.3 diff --git a/dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild b/dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild new file mode 100644 index 000000000000..ea32d4ffc9c8 --- /dev/null +++ b/dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit qt5-build + +DESCRIPTION="Wayland platform plugin for Qt" + +if [[ ${QT5_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +fi + +IUSE="vulkan X" + +DEPEND=" + >=dev-libs/wayland-1.6.0 + ~dev-qt/qtcore-${PV} + ~dev-qt/qtdeclarative-${PV} + ~dev-qt/qtgui-${PV}[egl,libinput,vulkan=] + media-libs/mesa[egl] + >=x11-libs/libxkbcommon-0.2.0 + vulkan? ( dev-util/vulkan-headers ) + X? ( + ~dev-qt/qtgui-${PV}[-gles2-only] + x11-libs/libX11 + x11-libs/libXcomposite + ) +" +RDEPEND="${DEPEND}" + +PATCHES=( "${FILESDIR}"/${P}-qtwaylandscanner-avoid-dangling-pointers.patch ) + +src_configure() { + local myqmakeargs=( + -- + $(qt_use vulkan feature-wayland-vulkan-server-buffer) + $(qt_use X feature-xcomposite-egl) + $(qt_use X feature-xcomposite-glx) + ) + qt5-build_src_configure +} |