From 904dbbcf9b860eef8c8722cae2fe4173302ebef9 Mon Sep 17 00:00:00 2001 From: Wonki Kim Date: Wed, 13 Feb 2019 10:43:23 -0500 Subject: [PATCH] ecore_wl2: replace strcpy with strncpy Summary: this patch replaces a volnerable function with a safer one. Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7920 Change-Id: I7e83ba8c07dd3dfab892e67f00582c1692d802e7 --- src/lib/ecore_wl2/ecore_wl2_input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 634e623..def1474 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -962,9 +962,9 @@ _ecore_wl2_input_key_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, xkb_ ev->compose = comp_len ? ev->key + key_len + 1 : NULL; ev->string = ev->compose; - strcpy((char *)ev->keyname, keyname); - strcpy((char *)ev->key, key); - if (comp_len) strcpy((char *)ev->compose, compose); + strncpy((char *)ev->keyname, keyname, key_len + 1); + strncpy((char *)ev->key, key, name_len + 1); + if (comp_len) strncpy((char *)ev->compose, compose, comp_len +1); // TIZEN_ONLY(20171107): support a tizen_keyrouter interface if (window) -- 2.7.4