summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Small <csmall@enc.com.au>2013-09-11 21:57:10 +1000
committerCraig Small <csmall@enc.com.au>2013-09-11 21:57:10 +1000
commit71305c095a4129c5e8244e6966a5177c5f7b415e (patch)
treea51a8434a7ba58bc2dba6bb1cbb41803967c90f8
parentc9378261370bbaf8d0798c9c2ea949763b34dc61 (diff)
parent5c9c7c8b1f92cdc66f6ec0d22990cee5edbf5a78 (diff)
downloadprocps-ng-71305c095a4129c5e8244e6966a5177c5f7b415e.tar.gz
Fix integer overflow in getstat()
Merge request 16
-rw-r--r--proc/sysinfo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/proc/sysinfo.c b/proc/sysinfo.c
index 9e3c9ec..f318376 100644
--- a/proc/sysinfo.c
+++ b/proc/sysinfo.c
@@ -494,7 +494,8 @@ void getstat(jiff *restrict cuse, jiff *restrict cice, jiff *restrict csys, jiff
getrunners(running, blocked);
}
- (*running)--; // exclude vmstat itself
+ if(*running)
+ (*running)--; // exclude vmstat itself
if(need_vmstat_file){ /* Linux 2.5.40-bk4 and above */
vminfo();