mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
proc_pase: Make sure we may scan up to 15 symbols in name
And do not use strcpy, better to stick with strncpy. Moreover, to be on a safe side make proc internal buffer big enough even for "(%16s)" format, it's hardly possible that the kernel ever change stat format but just to be on a safe side. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
@@ -449,7 +449,7 @@ static int get_task_stat(pid_t pid, int pid_dir, u8 *comm, u32 *flags,
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
strcpy((char *)comm, pps_buf.comm);
|
||||
strncpy((char *)comm, pps_buf.comm, TASK_COMM_LEN);
|
||||
*flags = pps_buf.flags;
|
||||
*start_code = pps_buf.start_code;
|
||||
*end_code = pps_buf.end_code;
|
||||
|
Reference in New Issue
Block a user