Browse Source

should prevent a buffer overflow in tagbuffer

Signed-off-by: gregory guy <g-gregory@gmx.fr>
pull/4/head
gregory guy 4 years ago committed by Michele Calgaro
parent
commit
e816bb8048
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF
  1. 2
      kcpuload/kcpuload/kcpuproc.cpp

2
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

Loading…
Cancel
Save