mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +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
@ -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 image_dir_size = strlen(image_dir);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
strcpy(path, image_dir);
|
strncpy(path, image_dir, size);
|
||||||
path[image_dir_size] = '/';
|
path[image_dir_size] = '/';
|
||||||
size -= image_dir_size + 1;
|
size -= image_dir_size + 1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user