SHA256
1
0
forked from pool/kpat

Accepting request 729128 from home:wolfi323:branches:KDE:Applications

- Add FcSolveSolver-cleanup-ressources.patch to fix crashes due to resource exhaustion (boo#1146622, kde#395624)

OBS-URL: https://build.opensuse.org/request/show/729128
OBS-URL: https://build.opensuse.org/package/show/KDE:Applications/kpat?expand=0&rev=102
This commit is contained in:
Christophe Giboudeaux 2019-09-07 21:01:53 +00:00 committed by Git OBS Bridge
parent d81d35c09c
commit fc355bfa86
3 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,37 @@
From d7fcc9a0c79f186118e0c20804af1f7467fc4580 Mon Sep 17 00:00:00 2001
From: Fabian Kosmale <0inkane@googlemail.com>
Date: Thu, 29 Aug 2019 18:33:13 +0200
Subject: FcSolveSolver: cleanup ressources
The FcSolveSolver did not call its free function in patsolve, leading to
ressource exhaustion.
BUG: 395624
---
patsolve/abstract_fc_solve_solver.cpp | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/patsolve/abstract_fc_solve_solver.cpp b/patsolve/abstract_fc_solve_solver.cpp
index c82aee1..725c703 100644
--- a/patsolve/abstract_fc_solve_solver.cpp
+++ b/patsolve/abstract_fc_solve_solver.cpp
@@ -55,6 +55,16 @@ SolverInterface::ExitStatus FcSolveSolver::patsolve( int _max_positions )
init();
+ // call free once the function ends. ### Replace this mess with QScopeGuard once we can use Qt 5.12
+ auto cleanup = [this](){this->free();};
+ using CleanupFunction = decltype (cleanup);
+ struct CleanupHandler {
+ CleanupHandler(CleanupFunction cleanup) : m_cleanup(std::move(cleanup)) {}
+ ~CleanupHandler() { m_cleanup();}
+
+ CleanupFunction m_cleanup;
+ } cleaner(cleanup);
+
int no_use = 0;
int num_moves = 0;
const auto get_possible_moves__ret = get_possible_moves(&no_use, &num_moves);
--
cgit v1.1

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Sep 7 20:33:21 UTC 2019 - Wolfgang Bauer <wbauer@tmo.at>
- Add FcSolveSolver-cleanup-ressources.patch to fix crashes due to
resource exhaustion (boo#1146622, kde#395624)
-------------------------------------------------------------------
Thu Sep 5 14:00:53 UTC 2019 - Luca Beltrame <lbeltrame@kde.org>

View File

@ -32,6 +32,8 @@ Source: https://download.kde.org/stable/applications/%{version}/src/%{na
Source1: https://download.kde.org/stable/applications/%{version}/src/%{name}-%{version}.tar.xz.sig
Source2: applications.keyring
%endif
# PATCH-FIX-UPSTREAM
Patch0: FcSolveSolver-cleanup-ressources.patch
BuildRequires: extra-cmake-modules
BuildRequires: freecell-solver-devel
BuildRequires: kcompletion-devel
@ -81,6 +83,7 @@ more. The game has nice graphics and many different carddecks.
%prep
%setup -q
%autopatch -p1
%build
%cmake_kf5 -d build