From 3388ed6367e3b8d2ff368a0e5efa24a5c9240e0f Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Mon, 29 Oct 2018 15:53:20 +0900 Subject: [PATCH] use the strncpy and the strncat Change-Id: I449126b9195eb26915a589fa1852dbcee0c7bb54 --- src/tbm_bufmgr_shm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tbm_bufmgr_shm.c b/src/tbm_bufmgr_shm.c index 8d4cfb0..3315b68 100644 --- a/src/tbm_bufmgr_shm.c +++ b/src/tbm_bufmgr_shm.c @@ -262,8 +262,8 @@ _shm_create_anonymous_file(off_t size) if (!name) return -1; - strcpy(name, path); - strcat(name, template); + strncpy(name, path, strlen(path)); + strncat(name, template, sizeof(template)); fd = _shm_create_tmpfile_cloexec(name); -- 2.7.4