Use PATH_MAX-1 as strncopy doesn't always set the final null byte

This commit is contained in:
Marc Di Luzio 2019-05-21 09:06:27 +01:00
parent 44ab695246
commit 83c4d38858

View File

@ -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;
}