From a8d5f275c780692df8a63897601a0c05e48678ac Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 18 Feb 2019 14:47:14 +0900 Subject: [PATCH] evas vg: use strncpy() instead of strcpy() for better security. --- src/lib/evas/vg/evas_vg_cache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c index ec5fc6b0be..9833ef65ae 100644 --- a/src/lib/evas/vg/evas_vg_cache.c +++ b/src/lib/evas/vg/evas_vg_cache.c @@ -181,8 +181,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) {