Fix buffer reuse.

This commit is contained in:
Hisham 2016-02-13 02:18:28 -02:00
parent e9b32eb62f
commit 0b70439316

View File

@ -446,7 +446,7 @@ static void LinuxProcessList_readOomData(LinuxProcess* process, const char* dirn
}
static void setCommand(Process* process, const char* command, int len) {
if (process->comm && process->commLen <= len) {
if (process->comm && process->commLen >= len) {
strncpy(process->comm, command, len + 1);
} else {
free(process->comm);