From 604bc6503d9bcaa573b9f201d75bbdc4c936f3cc Mon Sep 17 00:00:00 2001 From: gregory guy Date: Thu, 30 Aug 2018 16:22:55 +0200 Subject: [PATCH] should prevent a buffer overflow in tagbuffer Signed-off-by: gregory guy (cherry picked from commit e816bb80487fbfbc1406f8642eedda9486397dd7) --- kcpuload/kcpuload/kcpuproc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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