From 38174fffd79f54a8be7642bf170a2320b29e8063 Mon Sep 17 00:00:00 2001 From: "Eugene V. Lyubimkin" Date: Wed, 21 Sep 2011 21:17:17 +0300 Subject: Imported Debian patch 0.9-4 --- debian/changelog | 10 ++++++++++ debian/patches/100-fix-cgroups-crash.patch | 18 ++++++++++++++++++ debian/patches/series | 1 + debian/rules | 2 ++ 4 files changed, 31 insertions(+) create mode 100644 debian/patches/100-fix-cgroups-crash.patch diff --git a/debian/changelog b/debian/changelog index 11792da..edf4fab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +htop (0.9-4) unstable; urgency=low + + * debian/rules: + - Added 'build-arch' and 'build-indep' targets as suggested by Lintian. + * debian/patches: + - New patch 100-fix-cgroups-crash.patch fixing a crash when htop receives + an unexpected input from a cgroups file. (Closes: #628040) + + -- Eugene V. Lyubimkin Wed, 21 Sep 2011 21:17:17 +0300 + htop (0.9-3) unstable; urgency=low * debian/rules: diff --git a/debian/patches/100-fix-cgroups-crash.patch b/debian/patches/100-fix-cgroups-crash.patch new file mode 100644 index 0000000..4ba95cb --- /dev/null +++ b/debian/patches/100-fix-cgroups-crash.patch @@ -0,0 +1,18 @@ +diff --git a/ProcessList.c b/ProcessList.c +index c234357..3bb1b81 100644 +--- a/ProcessList.c ++++ b/ProcessList.c +@@ -473,7 +473,12 @@ static void ProcessList_readCGroupFile(Process* process, const char* dirname, co + char** fields = String_split(trimmed, ':'); + free(trimmed); + +- process->cgroup = strndup(fields[2] + 1, 10); ++ if (!fields[1] || !fields[2]) { ++ process->cgroup = strdup(""); // cgroups do not work ++ } ++ else { ++ process->cgroup = strndup(fields[2] + 1, 10); ++ } + String_freeArray(fields); + } + fclose(file); diff --git a/debian/patches/series b/debian/patches/series index c8aa567..7204157 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ +100-fix-cgroups-crash.patch 600-openvz-veid-on-kernels-gt-2.6.18.patch 700-ltrace-support.patch diff --git a/debian/rules b/debian/rules index 94bbaf1..6c67a3b 100755 --- a/debian/rules +++ b/debian/rules @@ -30,6 +30,8 @@ config.status: configure $(QUILT_STAMPFN) --enable-cgroup build: build-stamp +build-arch: build +build-indep: build build-stamp: config.status scripts/MakeHeader.py Process.c dh build --before dh_auto_configure -- cgit v1.2.3