diff options
Diffstat (limited to 'fast-import.c')
-rw-r--r-- | fast-import.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fast-import.c b/fast-import.c index 895c6b4a7e..cf6d8bc0ce 100644 --- a/fast-import.c +++ b/fast-import.c @@ -644,8 +644,9 @@ static void *pool_calloc(size_t count, size_t size) static char *pool_strdup(const char *s) { - char *r = pool_alloc(strlen(s) + 1); - strcpy(r, s); + size_t len = strlen(s) + 1; + char *r = pool_alloc(len); + memcpy(r, s, len); return r; } |