summaryrefslogtreecommitdiff
path: root/src/bin/eolian/common_funcs.c
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2015-07-30 14:21:55 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2015-07-30 14:28:09 +0200
commita76ca973886e863666fddd1964f5dcfd83bb6a08 (patch)
treef02ef80971a005abca74fc0223407f9efeb2ffeb /src/bin/eolian/common_funcs.c
parent465bffcf7d10122b57406a7f2ff3ee034c0b531f (diff)
eolian/common_funcs: Play safe and use strncpy
Not very likely but better play safe and make sure we don not overrun our destination buffer here. CID: 1311352
Diffstat (limited to '')
-rw-r--r--src/bin/eolian/common_funcs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/eolian/common_funcs.c b/src/bin/eolian/common_funcs.c
index 5ebd6cc0b0..837a8d973c 100644
--- a/src/bin/eolian/common_funcs.c
+++ b/src/bin/eolian/common_funcs.c
@@ -88,16 +88,16 @@ _class_func_env_create(const Eolian_Class *class, const char *funcname, Eolian_F
88 if (aftype == EOLIAN_PROPERTY) aftype = EOLIAN_METHOD; 88 if (aftype == EOLIAN_PROPERTY) aftype = EOLIAN_METHOD;
89 89
90 Eina_Stringshare *fname = eolian_function_full_c_name_get(funcid, aftype, EINA_FALSE); 90 Eina_Stringshare *fname = eolian_function_full_c_name_get(funcid, aftype, EINA_FALSE);
91 strcpy(p = env->upper_eo_func, fname); 91 strncpy(p = env->upper_eo_func, fname, PATH_MAX - 1);
92 eina_str_toupper(&p); 92 eina_str_toupper(&p);
93 strcpy(p = env->lower_eo_func, fname); 93 strncpy(p = env->lower_eo_func, fname, PATH_MAX - 1);
94 eina_str_tolower(&p); 94 eina_str_tolower(&p);
95 eina_stringshare_del(fname); 95 eina_stringshare_del(fname);
96 96
97 Eina_Stringshare *lname = eolian_function_full_c_name_get(funcid, aftype, EINA_TRUE); 97 Eina_Stringshare *lname = eolian_function_full_c_name_get(funcid, aftype, EINA_TRUE);
98 env->legacy_func[0] = '\0'; 98 env->legacy_func[0] = '\0';
99 if (!lname) return; 99 if (!lname) return;
100 strcpy(p = env->legacy_func, lname); 100 strncpy(p = env->legacy_func, lname, PATH_MAX - 1);
101 eina_stringshare_del(lname); 101 eina_stringshare_del(lname);
102} 102}
103 103