From: Hermet Park Date: Wed, 21 Sep 2016 06:38:54 +0000 (+0900) Subject: edje edje_cc_handlers: use strncpy() instead of strcpy() X-Git-Tag: accepted/tizen/common/20160927.152708~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F33%2F88933%2F2;p=platform%2Fupstream%2Fefl.git edje edje_cc_handlers: use strncpy() instead of strcpy() strncpy is better for security. Change-Id: I9b03ba0c4076704e9d9c92033b530e30d5fbb20e --- diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 72f7f89..7fa0917 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -14443,9 +14443,9 @@ Eina_Bool ninepatch_image_info_get(char* name, int *w, int *h, int* borderleft, info = (NinePatch_Image_Info*)calloc(1, sizeof(NinePatch_Image_Info)); - info->name = (char*)calloc(strlen(name) + 1, sizeof(char)); - strcpy(info->name, name); - + int info_name_size = strlen(name) + 1; + info->name = (char*)calloc(info_name_size, sizeof(char)); + strncpy(info->name, name, info_name_size); evas_object_image_size_get(obj_img, &info->w, &info->h);