diff --git a/0001-fix-QVariant-should-be-created-with-QMetaProperty-us.patch b/0001-fix-QVariant-should-be-created-with-QMetaProperty-us.patch new file mode 100644 index 0000000..8191b68 --- /dev/null +++ b/0001-fix-QVariant-should-be-created-with-QMetaProperty-us.patch @@ -0,0 +1,44 @@ +From b25f776b1761fb4b3bfbcb040da726ea5599fa56 Mon Sep 17 00:00:00 2001 +From: Robin Lee +Date: Tue, 3 Nov 2020 16:34:36 +0800 +Subject: [PATCH] fix: QVariant should be created with + QMetaProperty::userType() + +QMetaProperty::type() always returns QVariant::UserType for any user-defined +type. So QVariant of type id 1024(QVariant::UserType) is always created instead +of the right type whose type ID is returned from QMetaProperty::userType(). +Creating QVariant with wrong type may crash the process. + +Fixes RHBZ#1892710 + +Log: QVariant should be created with QMetaProperty::userType() +Signed-off-by: Robin Lee +--- + .../qtdbusextended/dbusextendedabstractinterface.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libdframeworkdbus/qtdbusextended/dbusextendedabstractinterface.cpp b/libdframeworkdbus/qtdbusextended/dbusextendedabstractinterface.cpp +index d66be11..06a0550 100644 +--- a/libdframeworkdbus/qtdbusextended/dbusextendedabstractinterface.cpp ++++ b/libdframeworkdbus/qtdbusextended/dbusextendedabstractinterface.cpp +@@ -177,7 +177,7 @@ QVariant DBusExtendedAbstractInterface::internalPropGet(const char *propname, vo + if (m_useCache) { + int propertyIndex = metaObject()->indexOfProperty(propname); + QMetaProperty metaProperty = metaObject()->property(propertyIndex); +- return QVariant(metaProperty.type(), propertyPtr); ++ return QVariant(metaProperty.userType(), propertyPtr); + } + + if (m_sync) { +@@ -233,7 +233,7 @@ QVariant DBusExtendedAbstractInterface::internalPropGet(const char *propname, vo + } + + asyncProperty(propname); +- return QVariant(metaProperty.type(), propertyPtr); ++ return QVariant(metaProperty.userType(), propertyPtr); + } + } + +-- +2.26.2 + diff --git a/deepin-qt-dbus-factory.spec b/deepin-qt-dbus-factory.spec index 63b19bf..52a1e83 100644 --- a/deepin-qt-dbus-factory.spec +++ b/deepin-qt-dbus-factory.spec @@ -3,13 +3,15 @@ Name: deepin-qt-dbus-factory Version: 5.0.1 -Release: 7%{?dist} +Release: 8%{?dist} Summary: A repository stores auto-generated Qt5 dbus code # The entire source code is GPLv3+ except # libdframeworkdbus/qtdbusextended/ which is LGPLv2+ License: GPLv3+ and LGPLv2+ URL: https://github.com/linuxdeepin/dde-qt-dbus-factory Source0: %{url}/archive/%{version}/%{repo}-%{version}.tar.gz +# https://github.com/linuxdeepin/dde-qt-dbus-factory/pull/19 +Patch0: 0001-fix-QVariant-should-be-created-with-QMetaProperty-us.patch BuildRequires: python3 BuildRequires: pkgconfig(gl) @@ -31,6 +33,7 @@ Header files and libraries for %{name}. %prep %setup -q -n %{repo}-%{version} +%patch0 -p1 sed -i 's|python|python3|' libdframeworkdbus/*.{pro,py} %build @@ -54,6 +57,9 @@ sed -i 's|python|python3|' libdframeworkdbus/*.{pro,py} %{_libdir}/lib%{soname}.so %changelog +* Tue Nov 3 2020 Robin Lee - 5.0.1-8 +- Fix RHBZ#1892710 + * Fri Sep 11 2020 Jan Grulich - 5.0.1-7 - rebuild (qt5)