2
0
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:
Cyrill Gorcunov 2011-12-19 15:37:05 +04:00
parent 6485fbd25f
commit 08faefd6bb

View File

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