mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-24 10:38:06 +00:00
crtools: Use safe strncpy in get_image_path
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by: Pavel Emelianov <xemul@parallels.com>
This commit is contained in:
parent
6485fbd25f
commit
08faefd6bb
1 changed files with 1 additions and 1 deletions
|
|
@ -237,7 +237,7 @@ int get_image_path(char *path, int size, const char *fmt, int pid)
|
|||
int image_dir_size = strlen(image_dir);
|
||||
int ret;
|
||||
|
||||
strcpy(path, image_dir);
|
||||
strncpy(path, image_dir, size);
|
||||
path[image_dir_size] = '/';
|
||||
size -= image_dir_size + 1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue