forked from enlightenment/efl
ecore_win32: don't allocate Ecore_Event_Key events with NULL keys
If "keyname" and "key" are NULL an Ecore_Event_Key is allocated throught calloc. strlen() is called on these variables, which crashes the program. As it is not correct to return a key event for NULL keys to ecore, it is preferrable to return NULL and exit the function before the key event is allocated, which fixes the crash in the same time. @fix Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
0e671630f1
commit
26253f6de4
|
@ -1334,6 +1334,9 @@ _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
|
|||
}
|
||||
}
|
||||
|
||||
if (!keyname || !key)
|
||||
return NULL;
|
||||
|
||||
e = (Ecore_Event_Key *)calloc(1, sizeof(Ecore_Event_Key) +
|
||||
strlen(keyname) + 1 +
|
||||
strlen(key) + 1 +
|
||||
|
|
Loading…
Reference in New Issue