mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-06 07:37:21 +02:00
Use PATH_MAX-1 as strncopy doesn't always set the final null byte
This commit is contained in:
parent
44ab695246
commit
83c4d38858
@ -595,7 +595,7 @@ static GameModeClient *game_mode_client_new(pid_t pid, char *executable)
|
||||
return NULL;
|
||||
}
|
||||
*ret = c;
|
||||
strncpy(ret->executable, executable, PATH_MAX);
|
||||
strncpy(ret->executable, executable, PATH_MAX - 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user