mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
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) {
|
||||
if (process->comm && process->commLen <= len) {
|
||||
if (process->comm && process->commLen >= len) {
|
||||
strncpy(process->comm, command, len + 1);
|
||||
} else {
|
||||
free(process->comm);
|
||||
|
Loading…
Reference in New Issue
Block a user