From 276b3ac020b1fa2e6ef266ef932878b4363f37089a85a342d46345ffea4d127c Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 10 Mar 2016 20:26:08 +0000 Subject: [PATCH] Accepting request 365634 from home:develop7:branches:Base:System htop-2.0.0-fix-buffer-reuse.patch: upstream fix for crash with SIGABRT OBS-URL: https://build.opensuse.org/request/show/365634 OBS-URL: https://build.opensuse.org/package/show/Base:System/htop?expand=0&rev=33 --- htop-2.0.0-fix-buffer-reuse.patch | 22 ++++++++++++++++++++++ htop.changes | 5 +++++ htop.spec | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 htop-2.0.0-fix-buffer-reuse.patch diff --git a/htop-2.0.0-fix-buffer-reuse.patch b/htop-2.0.0-fix-buffer-reuse.patch new file mode 100644 index 0000000..fdec3dd --- /dev/null +++ b/htop-2.0.0-fix-buffer-reuse.patch @@ -0,0 +1,22 @@ +From 0b70439316b4e4608c0916317ded7e6e56982de6 Mon Sep 17 00:00:00 2001 +From: Hisham +Date: Sat, 13 Feb 2016 02:18:28 -0200 +Subject: [PATCH] Fix buffer reuse. + +--- + linux/LinuxProcessList.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c +index 591210e..ec643ab 100644 +--- a/linux/LinuxProcessList.c ++++ b/linux/LinuxProcessList.c +@@ -446,7 +446,7 @@ static void LinuxProcessList_readOomData(LinuxProcess* process, const char* dirn + } + + static void setCommand(Process* process, const char* command, int len) { +- if (process->comm && process->commLen <= len) { ++ if (process->comm && process->commLen >= len) { + strncpy(process->comm, command, len + 1); + } else { + free(process->comm); diff --git a/htop.changes b/htop.changes index 845e074..96de549 100644 --- a/htop.changes +++ b/htop.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Mar 3 17:25:17 UTC 2016 - develop7@develop7.info + +- htop-2.0.0-fix-buffer-reuse.patch: upstream fix for crash with SIGABRT + ------------------------------------------------------------------- Thu Feb 11 18:29:47 UTC 2016 - jimmy@boombatower.com diff --git a/htop.spec b/htop.spec index a7e4240..67bb4b4 100644 --- a/htop.spec +++ b/htop.spec @@ -26,6 +26,8 @@ Url: http://hisham.hm/htop Source0: http://hisham.hm/htop/releases/%{version}/%{name}-%{version}.tar.gz Patch0: htop-desktop-file-fix-thoenig-01.patch Patch1: htop-stdgnu.patch +# PATCH-FIX-UPSTREAM htop-2.0.0-fix-buffer-reuse.patch +Patch2: htop-2.0.0-fix-buffer-reuse.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: ncurses-devel @@ -47,6 +49,7 @@ but is also reported to work (and was originally developed) with the %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build autoreconf -fiv