summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlsj119 <lsj119@samsung.com>2018-11-09 14:02:10 +0900
committerlsj119 <lsj119@samsung.com>2018-11-09 14:02:10 +0900
commite215b5402b3792f4edc91f3a5d48268beebbdbce (patch)
treeac8bacdff86109832f445d39805d7cc1249c0573
parentae85577c4525e3da76261141f1487379a9d3ddd9 (diff)
downloadlibtbm-shm-e215b5402b3792f4edc91f3a5d48268beebbdbce.tar.gz
libtbm-shm-e215b5402b3792f4edc91f3a5d48268beebbdbce.tar.bz2
libtbm-shm-e215b5402b3792f4edc91f3a5d48268beebbdbce.zip
Fix bug for create_anonymous_file
Change-Id: I705bb1a8836fafb6d8c1bce39dabd40b33e0e44d
-rw-r--r--src/tbm_bufmgr_shm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tbm_bufmgr_shm.c b/src/tbm_bufmgr_shm.c
index 7de5bfb..d43d38f 100644
--- a/src/tbm_bufmgr_shm.c
+++ b/src/tbm_bufmgr_shm.c
@@ -262,8 +262,7 @@ _shm_create_anonymous_file(off_t size)
if (!name)
return -1;
- strncpy(name, path, strlen(path));
- strncat(name, template, sizeof(template));
+ snprintf(name, strlen(path) + sizeof(template), "%s%s", path, template);
fd = _shm_create_tmpfile_cloexec(name);