aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/mac/handler/dynamic_images.h5
1 files changed, 3 insertions, 2 deletions
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<char*>(malloc(strlen(inFilePath)));
- strcpy(file_path_, inFilePath);
+ size_t path_size = 1 + strlen(inFilePath);
+ file_path_ = reinterpret_cast<char*>(malloc(path_size));
+ strlcpy(file_path_, inFilePath, path_size);
} else {
file_path_ = NULL;
}