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
This commit is contained in:
Wonki Kim 2019-02-13 10:43:23 -05:00 committed by Christopher Michael
parent 80b364f392
commit 33c4041950
1 changed files with 3 additions and 3 deletions

View File

@ -635,9 +635,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);
ev->window = (Ecore_Window)window;
ev->event_window = (Ecore_Window)window;