Handle when backend fails to load/initialize

epel9
Jan Grulich 5 years ago
parent 51494fb3dc
commit 01954910fe

@ -0,0 +1,36 @@
From 069bb65af0d0059391323f9ffd2edd9162d57588 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil@kde.org>
Date: Mon, 24 Feb 2020 15:12:30 +0100
Subject: fix: handle when backend fails to load/initialize
Summary:
Fixes a null pointer dereference in GetConfigOperation when BackendManager
fails to load a valid backend.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D27625
---
src/getconfigoperation.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/getconfigoperation.cpp b/src/getconfigoperation.cpp
index 4cb9afb..f985845 100644
--- a/src/getconfigoperation.cpp
+++ b/src/getconfigoperation.cpp
@@ -171,6 +171,9 @@ void GetConfigOperation::start()
Q_D(GetConfigOperation);
if (BackendManager::instance()->method() == BackendManager::InProcess) {
auto backend = d->loadBackend();
+ if (!backend) {
+ return; // loadBackend() already set error and called emitResult() for us
+ }
d->config = backend->config()->clone();
d->loadEdid(backend);
emitResult();
--
cgit v1.1

@ -3,7 +3,7 @@
Name: libkscreen-qt5 Name: libkscreen-qt5
Summary: KDE display configuration library Summary: KDE display configuration library
Version: 5.18.2 Version: 5.18.2
Release: 1%{?dist} Release: 2%{?dist}
License: GPLv2+ License: GPLv2+
URL: https://cgit.kde.org/%{base_name}.git URL: https://cgit.kde.org/%{base_name}.git
@ -16,6 +16,7 @@ URL: https://cgit.kde.org/%{base_name}.git
%endif %endif
Source0: http://download.kde.org/%{stable}/plasma/%{version}/%{base_name}-%{version}.tar.xz Source0: http://download.kde.org/%{stable}/plasma/%{version}/%{base_name}-%{version}.tar.xz
Patch1: libkscreen-5.6.4-rhel-nowayland.patch Patch1: libkscreen-5.6.4-rhel-nowayland.patch
Patch2: libkscreen-handle-when-backend-fails-to-load.patch
# filter plugin provides # filter plugin provides
%global __provides_exclude_from ^(%{_kf5_plugindir}/.*\\.so)$ %global __provides_exclude_from ^(%{_kf5_plugindir}/.*\\.so)$
@ -58,6 +59,7 @@ developing applications that use %{name}.
%if 0%{?rhel} && 0%{?rhel} <= 7 %if 0%{?rhel} && 0%{?rhel} <= 7
%patch1 -p1 -b .nowayland %patch1 -p1 -b .nowayland
%endif %endif
%patch2 -p1 -b .handle-when-backend-fails-to-load
%build %build
@ -95,6 +97,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
%changelog %changelog
* Fri Feb 28 2020 Jan Grulich <jgrulich@redhat.com> - 5.18.2-2
- Handle when backend fails to load/initialize
* Tue Feb 25 2020 Jan Grulich <jgrulich@redhat.com> - 5.18.2-1 * Tue Feb 25 2020 Jan Grulich <jgrulich@redhat.com> - 5.18.2-1
- 5.18.2 - 5.18.2

Loading…
Cancel
Save