From 2a8d7768844d00a8eb99c8d62395d98582fa2270 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 16 Aug 2019 16:31:54 -0700 Subject: [PATCH] pan/decode: Fix missing NULL terminator Signed-off-by: Alyssa Rosenzweig --- src/panfrost/pandecode/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/panfrost/pandecode/common.c b/src/panfrost/pandecode/common.c index 6154b3cd505..0678e459066 100644 --- a/src/panfrost/pandecode/common.c +++ b/src/panfrost/pandecode/common.c @@ -65,8 +65,8 @@ pandecode_inject_mmap(uint64_t gpu_va, void *cpu, unsigned sz, const char *name) snprintf(mapped_mem->name, ARRAY_SIZE(mapped_mem->name) - 1, "memory_%" PRIx64, gpu_va); } else { - assert(strlen(name) < ARRAY_SIZE(mapped_mem->name)); - memcpy(mapped_mem->name, name, strlen(name)); + assert((strlen(name) + 1) < ARRAY_SIZE(mapped_mem->name)); + memcpy(mapped_mem->name, name, strlen(name) + 1); } list_add(&mapped_mem->node, &mmaps.node); -- 2.30.2