From 08faefd6bb3318cd98c2f8a72a26d742bc51f536 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 19 Dec 2011 15:37:05 +0400 Subject: [PATCH] crtools: Use safe strncpy in get_image_path Signed-off-by: Cyrill Gorcunov Acked-by: Pavel Emelianov --- crtools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crtools.c b/crtools.c index 3a9582e79..9ea5269b5 100644 --- a/crtools.c +++ b/crtools.c @@ -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;