diff options
author | lsj119 <lsj119@samsung.com> | 2018-11-09 14:02:10 +0900 |
---|---|---|
committer | lsj119 <lsj119@samsung.com> | 2018-11-09 14:02:10 +0900 |
commit | e215b5402b3792f4edc91f3a5d48268beebbdbce (patch) | |
tree | ac8bacdff86109832f445d39805d7cc1249c0573 | |
parent | ae85577c4525e3da76261141f1487379a9d3ddd9 (diff) | |
download | libtbm-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.c | 3 |
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); |