You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-admin/conky/files/conky-1.10.6-cpu-hotplug.patch

24 lines
683 B

From 7d2639e9c489c34fa9673fcaee8deec46043fbf8 Mon Sep 17 00:00:00 2001
From: Daniel Pielmeier <billie80@users.noreply.github.com>
Date: Sat, 18 Feb 2017 16:55:35 +0100
Subject: [PATCH] Fix SEGV in a CPU hotplug environment #127
---
src/linux.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/linux.cc b/src/linux.cc
index 664ddf5e..63b3ea40 100644
--- a/src/linux.cc
+++ b/src/linux.cc
@@ -900,6 +900,9 @@ int update_stat(void)
} else {
idx = 0;
}
+ if (idx > info.cpu_count) {
+ continue;
+ }
sscanf(buf, stat_template, &(cpu[idx].cpu_user),
&(cpu[idx].cpu_nice), &(cpu[idx].cpu_system),
&(cpu[idx].cpu_idle), &(cpu[idx].cpu_iowait),