diff -Nru libproc-processtable-perl-0.45/debian/changelog libproc-processtable-perl-0.45/debian/changelog --- libproc-processtable-perl-0.45/debian/changelog 2011-11-07 11:23:58.000000000 -0500 +++ libproc-processtable-perl-0.45/debian/changelog 2012-12-23 11:01:55.000000000 -0500 @@ -1,3 +1,12 @@ +libproc-processtable-perl (0.45-4) unstable; urgency=low + + * Add 1093289-pctcpu-fix.patch + Fixes buffer overflow in pctcpu for up to 99 cpus + Based on patch in https://rt.cpan.org/Ticket/Display.html?id=82175 + LP: 1093289 + + -- Matthew L. Dailey Sun, 23 Dec 2012 10:59:40 -0500 + libproc-processtable-perl (0.45-3) unstable; urgency=low [ Ansgar Burchardt ] diff -Nru libproc-processtable-perl-0.45/debian/patches/1093289-pctcpu-fix.patch libproc-processtable-perl-0.45/debian/patches/1093289-pctcpu-fix.patch --- libproc-processtable-perl-0.45/debian/patches/1093289-pctcpu-fix.patch 1969-12-31 19:00:00.000000000 -0500 +++ libproc-processtable-perl-0.45/debian/patches/1093289-pctcpu-fix.patch 2012-12-23 11:06:00.000000000 -0500 @@ -0,0 +1,31 @@ +Description: Fix for buffer overflow in pctcpu + On systems with more than 9 logical CPUs, a process can use more than 999% of + CPU and overflow pctcpu. This patch increases the buffer so that it will work + for up to 99 logical CPUs. +Author: Matthew L. Dailey +Bug: https://rt.cpan.org/Public/Bug/Display.html?id=82175 +Bug-Ubuntu: https://launchpad.net/bugs/1093289 +Last-Update: 2012-12-23 + +--- libproc-processtable-perl-0.45.orig/os/Linux.h ++++ libproc-processtable-perl-0.45/os/Linux.h +@@ -42,7 +42,7 @@ struct procstat + char *cmndline; + char *exec; + /* other values */ +- char pctcpu[sizeof("100.00")]; /* precent cpu, without '%' char */ ++ char pctcpu[sizeof("1000.00")]; /* precent cpu, without '%' char */ + char pctmem[sizeof("100.00")]; /* precent memory, without '%' char */ + }; + +--- libproc-processtable-perl-0.45.orig/os/Linux.c ++++ libproc-processtable-perl-0.45/os/Linux.c +@@ -551,7 +551,7 @@ static void calc_prec(char *format_str, + float pctcpu = 100.0f * (prs->utime / 1e6) / (time(NULL) - prs->start_time); + + /* calculate pctcpu - NOTE: This assumes the cpu time is in microsecond units! */ +- sprintf(prs->pctcpu, "%3.2f", pctcpu); ++ sprintf(prs->pctcpu, "%4.2f", pctcpu); + field_enable(format_str, F_PCTCPU); + + /* calculate pctmem */ diff -Nru libproc-processtable-perl-0.45/debian/patches/series libproc-processtable-perl-0.45/debian/patches/series --- libproc-processtable-perl-0.45/debian/patches/series 2011-11-07 11:23:58.000000000 -0500 +++ libproc-processtable-perl-0.45/debian/patches/series 2012-12-23 11:02:05.000000000 -0500 @@ -1,2 +1,3 @@ spelling.patch 646785-add-new-states.patch +1093289-pctcpu-fix.patch