mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 22:35:33 +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:
@@ -1,12 +1,12 @@
|
||||
#ifndef PROC_PARSE_H__
|
||||
#define PROC_PARSE_H__
|
||||
|
||||
#define TASK_COMM_LEN 16
|
||||
#define TASK_COMM_LEN_FMT "(%15s"
|
||||
#define PROC_TASK_COMM_LEN 32
|
||||
#define PROC_TASK_COMM_LEN_FMT "(%31s"
|
||||
|
||||
struct proc_pid_stat {
|
||||
int pid;
|
||||
char comm[TASK_COMM_LEN];
|
||||
char comm[PROC_TASK_COMM_LEN];
|
||||
char state;
|
||||
int ppid;
|
||||
int pgid;
|
||||
|
Reference in New Issue
Block a user