summaryrefslogtreecommitdiff
path: root/src/lib/ecore_win32
diff options
context:
space:
mode:
authorRomain Perier <romain.perier@openwide.fr>2015-01-30 10:49:56 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-01-30 10:49:56 +0100
commit26253f6de454f2c77581e9e6221374895414c105 (patch)
treef25e0ed3a5e30ac5aa850e5ad4f5c2d8506c780f /src/lib/ecore_win32
parent0e671630f1aec35ded78c42961270ddb01f470e5 (diff)
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>
Diffstat (limited to 'src/lib/ecore_win32')
-rw-r--r--src/lib/ecore_win32/ecore_win32_event.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/ecore_win32/ecore_win32_event.c b/src/lib/ecore_win32/ecore_win32_event.c
index 2e1de2add9..f9d29a1a6f 100644
--- a/src/lib/ecore_win32/ecore_win32_event.c
+++ b/src/lib/ecore_win32/ecore_win32_event.c
@@ -1334,6 +1334,9 @@ _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
1334 } 1334 }
1335 } 1335 }
1336 1336
1337 if (!keyname || !key)
1338 return NULL;
1339
1337 e = (Ecore_Event_Key *)calloc(1, sizeof(Ecore_Event_Key) + 1340 e = (Ecore_Event_Key *)calloc(1, sizeof(Ecore_Event_Key) +
1338 strlen(keyname) + 1 + 1341 strlen(keyname) + 1 +
1339 strlen(key) + 1 + 1342 strlen(key) + 1 +