evas vg: use strncpy() instead of strcpy() for better security.
authorHermet Park <hermetpark@gmail.com>
Mon, 18 Feb 2019 05:47:14 +0000 (14:47 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Fri, 8 Mar 2019 11:49:34 +0000 (20:49 +0900)
src/lib/evas/vg/evas_vg_cache.c

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