commit:     13ada4b568106cabbccd59a7fefe7b913b02bf90
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 31 20:08:14 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Dec 31 20:08:50 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13ada4b5

kde-frameworks/plasma: Fix crash in calendar plugin

Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../plasma-5.65.0-calendar-out-of-bounds.patch     | 53 +++++++++++++++
 kde-frameworks/plasma/plasma-5.65.0-r1.ebuild      | 76 ++++++++++++++++++++++
 2 files changed, 129 insertions(+)

diff --git 
a/kde-frameworks/plasma/files/plasma-5.65.0-calendar-out-of-bounds.patch 
b/kde-frameworks/plasma/files/plasma-5.65.0-calendar-out-of-bounds.patch
new file mode 100644
index 00000000000..4c96921abd5
--- /dev/null
+++ b/kde-frameworks/plasma/files/plasma-5.65.0-calendar-out-of-bounds.patch
@@ -0,0 +1,53 @@
+From 6756d00fba11ca2af921a67acdb5e3c92e23bb8a Mon Sep 17 00:00:00 2001
+From: David Edmundson <[email protected]>
+Date: Wed, 18 Dec 2019 12:52:15 +0000
+Subject: [calendar] Check out of bounds array access in QLocale lookup
+
+Summary:
+If we have a broken locale setup we don't have any uiLanugages to look
+up the relevant locale object for.
+
+In that case use the system locale.
+
+Test Plan:
+Had a crash here
+
+#11 0x00007ff982aab0b2 in QList<QString>::at(int) const (this=0x7ffd50b1d928, 
i=0) at /opt/qt5/include/QtCore/qlist.h:571
+#12 0x00007ff982aaaa4a in Calendar::monthName() const (this=0x5640cce026f0) at 
/home/david/projects/kde5/src/frameworks/plasma-framework/src/declarativeimports/calendar/calendar.cpp:202
+#13 0x00007ff982aa14e9 in Calendar::qt_static_metacall(QObject*, 
QMetaObject::Call, int, void**) (_o=0x5640cce026f0, 
_c=QMetaObject::ReadProperty, _id=9, _a=0x7ffd50b1dd40) at 
src/declarativeimports/calendar/calendarplugin_autogen/EWIEGA46WW/moc_calendar.cpp:340
+
+Reviewers: #plasma, vkrause
+
+Reviewed By: vkrause
+
+Subscribers: kde-frameworks-devel
+
+Tags: #frameworks
+
+Differential Revision: https://phabricator.kde.org/D25960
+---
+ src/declarativeimports/calendar/calendar.cpp | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/declarativeimports/calendar/calendar.cpp 
b/src/declarativeimports/calendar/calendar.cpp
+index f652c65..c77824d 100644
+--- a/src/declarativeimports/calendar/calendar.cpp
++++ b/src/declarativeimports/calendar/calendar.cpp
+@@ -199,9 +199,12 @@ QString Calendar::monthName() const
+     // locale and take the month name from that.
+     //
+     // See https://bugs.kde.org/show_bug.cgi?id=353715
+-    const QString lang = QLocale().uiLanguages().at(0);
+-    // If lang is empty, it will create just a system locale
+-    QLocale langLocale(lang);
++
++    QLocale langLocale;
++
++    if (QLocale().uiLanguages().length() > 0) {
++        langLocale = QLocale(QLocale().uiLanguages().at(0));
++    }
+     return langLocale.standaloneMonthName(m_displayedDate.month());
+ }
+ 
+-- 
+cgit v1.1

diff --git a/kde-frameworks/plasma/plasma-5.65.0-r1.ebuild 
b/kde-frameworks/plasma/plasma-5.65.0-r1.ebuild
new file mode 100644
index 00000000000..29c9ed58b90
--- /dev/null
+++ b/kde-frameworks/plasma/plasma-5.65.0-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+KDE_ORG_NAME="${PN}-framework"
+PVCUT=$(ver_cut 1-2)
+QTMIN=5.12.3
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org
+
+DESCRIPTION="Plasma framework"
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="gles2 wayland X"
+
+# drop qtgui subslot operator when QT_MINIMAL >= 5.14.0
+BDEPEND="
+       >=kde-frameworks/kdoctools-${PVCUT}:5
+"
+RDEPEND="
+       >=kde-frameworks/kactivities-${PVCUT}:5
+       >=kde-frameworks/karchive-${PVCUT}:5
+       >=kde-frameworks/kconfig-${PVCUT}:5
+       >=kde-frameworks/kconfigwidgets-${PVCUT}:5
+       >=kde-frameworks/kcoreaddons-${PVCUT}:5
+       >=kde-frameworks/kdeclarative-${PVCUT}:5
+       >=kde-frameworks/kglobalaccel-${PVCUT}:5
+       >=kde-frameworks/kguiaddons-${PVCUT}:5
+       >=kde-frameworks/ki18n-${PVCUT}:5
+       >=kde-frameworks/kiconthemes-${PVCUT}:5
+       >=kde-frameworks/kio-${PVCUT}:5
+       >=kde-frameworks/kirigami-${PVCUT}:5
+       >=kde-frameworks/knotifications-${PVCUT}:5
+       >=kde-frameworks/kpackage-${PVCUT}:5
+       >=kde-frameworks/kservice-${PVCUT}:5
+       >=kde-frameworks/kwidgetsaddons-${PVCUT}:5
+       >=kde-frameworks/kwindowsystem-${PVCUT}:5
+       >=kde-frameworks/kxmlgui-${PVCUT}:5
+       >=dev-qt/qtdbus-${QTMIN}:5
+       >=dev-qt/qtdeclarative-${QTMIN}:5
+       >=dev-qt/qtgui-${QTMIN}:5=[gles2=]
+       >=dev-qt/qtquickcontrols-${QTMIN}:5
+       >=dev-qt/qtsql-${QTMIN}:5
+       >=dev-qt/qtsvg-${QTMIN}:5
+       >=dev-qt/qtwidgets-${QTMIN}:5
+       !gles2? ( virtual/opengl )
+       wayland? (
+               >=kde-frameworks/kwayland-${PVCUT}:5
+               media-libs/mesa[egl]
+       )
+       X? (
+               >=dev-qt/qtx11extras-${QTMIN}:5
+               x11-libs/libX11
+               x11-libs/libxcb
+       )
+"
+DEPEND="${RDEPEND}
+       X? ( x11-base/xorg-proto )
+"
+
+RESTRICT+=" test"
+
+PATCHES=( "${FILESDIR}/${P}-calendar-out-of-bounds.patch" )
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake_use_find_package !gles2 OpenGL)
+               $(cmake_use_find_package wayland EGL)
+               $(cmake_use_find_package wayland KF5Wayland)
+               $(cmake_use_find_package X X11)
+               $(cmake_use_find_package X XCB)
+       )
+
+       ecm_src_configure
+}

Reply via email to