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
This commit is contained in:
Dirk Mueller 2016-03-10 20:26:08 +00:00 committed by Git OBS Bridge
parent 412f2a797f
commit 276b3ac020
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,22 @@
From 0b70439316b4e4608c0916317ded7e6e56982de6 Mon Sep 17 00:00:00 2001
From: Hisham <hisham@gobolinux.org>
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);

View File

@ -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

View File

@ -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