diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-01-08 11:28:34 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-01-08 11:28:34 +0000 |
commit | 24fd814c326e282c4321965c31f341dad77e270d (patch) | |
tree | 033d63b33c21a3209964ab56005bb9bdd523630d /dev-qt/qtwayland/files | |
parent | 129160ec854dca4c3fedb5bcfbcb56930371da0f (diff) |
gentoo resync : 08.01.2021
Diffstat (limited to 'dev-qt/qtwayland/files')
-rw-r--r-- | dev-qt/qtwayland/files/qtwayland-5.15.2-qtwaylandscanner-avoid-dangling-pointers.patch | 35 |
1 files changed, 35 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 |