summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgregory guy <g-gregory@gmx.fr>2018-08-30 16:22:55 +0200
committerMichele Calgaro <michele.calgaro@yahoo.it>2018-08-31 11:40:39 +0900
commite816bb80487fbfbc1406f8642eedda9486397dd7 (patch)
tree38201c1ec6853c48d0e5271d0bc6efa433fd6eee
parent4453e3da71be3cca222adbe466f7167ad7c9030e (diff)
downloadkcpuload-e816bb80487fbfbc1406f8642eedda9486397dd7.tar.gz
kcpuload-e816bb80487fbfbc1406f8642eedda9486397dd7.zip
should prevent a buffer overflow in tagbuffer
Signed-off-by: gregory guy <g-gregory@gmx.fr>
-rw-r--r--kcpuload/kcpuload/kcpuproc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kcpuload/kcpuload/kcpuproc.cpp b/kcpuload/kcpuload/kcpuproc.cpp
index 7e5bc9b..f7fbe4f 100644
--- a/kcpuload/kcpuload/kcpuproc.cpp
+++ b/kcpuload/kcpuload/kcpuproc.cpp
@@ -171,7 +171,7 @@ void KCPUProc::readLoad() {
// ========== Linux-specific (begin) ==========
#ifdef Q_OS_LINUX
bool KCPUProc::CPU::parse(FILE* fd) {
- char tagbuffer[32];
+ char tagbuffer[32+1];
Ticks n; // new ticks
if (fscanf(fd, "%32s%d%d%d%d", tagbuffer, &n.U, &n.N, &n.S, &n.I) != 5) {
return false; // failure