From: Wonki Kim Date: Wed, 13 Feb 2019 15:43:23 +0000 (-0500) Subject: ecore_wl2: replace strcpy with strncpy X-Git-Tag: submit/tizen/20190222.001114~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F99%2F199899%2F1;p=platform%2Fupstream%2Fefl.git 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 --- 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)