eio: check that the file to be monitored is not an empty string.
authormichelle legrand <michelle.legrand@openwide.fr>
Tue, 3 Feb 2015 12:25:58 +0000 (13:25 +0100)
committerCedric BAIL <cedric@osg.samsung.com>
Wed, 11 Feb 2015 16:03:37 +0000 (17:03 +0100)
This fix segmentation faults on Windows caused by eio_monitor events.

@fix

src/lib/eio/eio_monitor_win32.c

index 12e87ca..d092802 100644 (file)
@@ -85,6 +85,9 @@ _eio_monitor_win32_cb(void *data, Ecore_Win32_Handler *wh EINA_UNUSED)
       if (!wname)
         return 0;
 
+      if (fni->FileName[0] == 0)
+        return ECORE_CALLBACK_CANCEL;
+
       memcpy(wname, fni->FileName, fni->FileNameLength);
       wname[fni->FileNameLength / sizeof(wchar_t)] = 0;
       name = evil_wchar_to_char(wname);