Dirk Mueller
276b3ac020
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
23 lines
797 B
Diff
23 lines
797 B
Diff
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);
|