commit:     130b50cbf5d0e6093dfdb8fd7d60e5c9e9f999d7
Author:     Daniel Pielmeier <billie <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 18 11:45:37 2017 +0000
Commit:     Daniel Pielmeier <billie <AT> gentoo <DOT> org>
CommitDate: Sat Nov 18 11:46:00 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=130b50cb

app-admin/conky: Fix bug 556480.

Thanks to devsk for the patch and report.

Package-Manager: Portage-2.3.13, Repoman-2.3.3

 ...nky-1.10.6-r3.ebuild => conky-1.10.6-r4.ebuild} |  1 +
 .../conky/files/conky-1.10.6-cpu-hotplug.patch     | 23 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/app-admin/conky/conky-1.10.6-r3.ebuild 
b/app-admin/conky/conky-1.10.6-r4.ebuild
similarity index 99%
rename from app-admin/conky/conky-1.10.6-r3.ebuild
rename to app-admin/conky/conky-1.10.6-r4.ebuild
index 2f866b42728..0f6c02c40c0 100644
--- a/app-admin/conky/conky-1.10.6-r3.ebuild
+++ b/app-admin/conky/conky-1.10.6-r4.ebuild
@@ -77,6 +77,7 @@ PATCHES=(
        "${FILESDIR}"/${P}-new_graph-oor.patch
        "${FILESDIR}"/${P}-gcc-7.patch
        "${FILESDIR}"/${P}-fix-text-shades.patch
+       "${FILESDIR}"/${P}-cpu-hotplug.patch
 )
 
 DISABLE_AUTOFORMATTING="yes"

diff --git a/app-admin/conky/files/conky-1.10.6-cpu-hotplug.patch 
b/app-admin/conky/files/conky-1.10.6-cpu-hotplug.patch
new file mode 100644
index 00000000000..16adbd8a690
--- /dev/null
+++ b/app-admin/conky/files/conky-1.10.6-cpu-hotplug.patch
@@ -0,0 +1,23 @@
+From 7d2639e9c489c34fa9673fcaee8deec46043fbf8 Mon Sep 17 00:00:00 2001
+From: Daniel Pielmeier <[email protected]>
+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),

Reply via email to