From: Alyssa Rosenzweig Date: Fri, 16 Aug 2019 23:31:54 +0000 (-0700) Subject: pan/decode: Fix missing NULL terminator X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2a8d7768844d00a8eb99c8d62395d98582fa2270;p=mesa.git pan/decode: Fix missing NULL terminator Signed-off-by: Alyssa Rosenzweig --- 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);