From eaadf861e7a6aaa04762ccd6a52958a59622ec53 Mon Sep 17 00:00:00 2001 From: Adam Moody Date: Mon, 6 Jul 2020 16:30:37 -0700 Subject: [PATCH] mfu: use strncpy to pad short paths with zero when writing cache file Signed-off-by: Adam Moody --- src/common/mfu_flist_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/mfu_flist_io.c b/src/common/mfu_flist_io.c index 516b8146e..1e25d2093 100644 --- a/src/common/mfu_flist_io.c +++ b/src/common/mfu_flist_io.c @@ -86,7 +86,7 @@ static void buft_pack(void* buf, const buf_t* items) sptr += items->chars; dptr += items->chars; - /* pack uint64 into destionation */ + /* pack uint64 into destination */ mfu_pack_io_uint64(&dptr, *(const uint64_t*)sptr); sptr += sizeof(uint64_t); } @@ -247,7 +247,7 @@ static size_t list_elem_pack(void* buf, int detail, uint64_t chars, const elem_t /* copy in file name */ char* file = elem->file; - strcpy(ptr, file); + strncpy(ptr, file, chars); ptr += chars; if (detail) {