use the strncpy and the strncat 40/192040/1
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 29 Oct 2018 06:53:20 +0000 (15:53 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 29 Oct 2018 06:53:20 +0000 (15:53 +0900)
Change-Id: I449126b9195eb26915a589fa1852dbcee0c7bb54

src/tbm_bufmgr_shm.c

index 8d4cfb0..3315b68 100644 (file)
@@ -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);