evas vg: use strncpy() instead of strcpy() for better security. 07/200007/2
authorHermet Park <hermetpark@gmail.com>
Mon, 18 Feb 2019 05:47:14 +0000 (14:47 +0900)
committerHermet Park <chuneon.park@samsung.com>
Mon, 18 Feb 2019 06:40:04 +0000 (06:40 +0000)
Change-Id: I950e52cd82ea92a644be4237a0f0724dafa3f504

src/lib/evas/vg/evas_vg_cache.c

index 652f9eb..262127a 100644 (file)
@@ -191,8 +191,9 @@ _vg_file_save(Vg_File_Data *vfd, const char *file, const char *key, const char *
         char *p, *pp;
         char *tflags;
 
-        tflags = alloca(strlen(flags) + 1);
-        strcpy(tflags, flags);
+        int len = strlen(flags);
+        tflags = alloca(len) + 1;
+        strncpy(tflags, flags, len);
         p = tflags;
         while (p)
           {