diff --git a/src/client/mac/handler/dynamic_images.h b/src/client/mac/handler/dynamic_images.h index 497f4eb4..4c4ab7ff 100644 --- a/src/client/mac/handler/dynamic_images.h +++ b/src/client/mac/handler/dynamic_images.h @@ -158,8 +158,9 @@ class DynamicImage { // Makes local copy of file path to mach-o binary void InitializeFilePath(char *inFilePath) { if (inFilePath) { - file_path_ = reinterpret_cast(malloc(strlen(inFilePath))); - strcpy(file_path_, inFilePath); + size_t path_size = 1 + strlen(inFilePath); + file_path_ = reinterpret_cast(malloc(path_size)); + strlcpy(file_path_, inFilePath, path_size); } else { file_path_ = NULL; }