diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-16 16:31:54 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-21 08:40:52 -0700 |
commit | 2a8d7768844d00a8eb99c8d62395d98582fa2270 (patch) | |
tree | d41c9d0f6782a9ab1cdcf06f1de0b61172de7d92 | |
parent | 6c67bd05a6b186f7a0d4a17d92602da8449f776b (diff) |
pan/decode: Fix missing NULL terminator
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/panfrost/pandecode/common.c | 4 |
1 files 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); |