mirror of https://github.com/xzeldon/htop.git
Fix buffer reuse.
This commit is contained in:
parent
e9b32eb62f
commit
0b70439316
|
@ -446,7 +446,7 @@ static void LinuxProcessList_readOomData(LinuxProcess* process, const char* dirn
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setCommand(Process* process, const char* command, int len) {
|
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);
|
strncpy(process->comm, command, len + 1);
|
||||||
} else {
|
} else {
|
||||||
free(process->comm);
|
free(process->comm);
|
||||||
|
|
Loading…
Reference in New Issue