diff options
author | Cedric Bail <cedric@osg.samsung.com> | 2016-07-15 17:02:03 -0700 |
---|---|---|
committer | Cedric Bail <cedric@osg.samsung.com> | 2016-07-15 17:07:49 -0700 |
commit | e93d6f90db2b4b2bf281e9eb810aaa2338ba2737 (patch) | |
tree | 346a24942ae8674698319165eb96880de373d6bc | |
parent | bf369ba66197a62921124bfa2e5d22b1945bfaf3 (diff) |
eio: avoid access after death of eio handler due to inotify triggering IN_IGNORED event.
-rw-r--r-- | src/lib/eio/eio_monitor_inotify.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/eio/eio_monitor_inotify.c b/src/lib/eio/eio_monitor_inotify.c index faa34b3de4..2222a56476 100644 --- a/src/lib/eio/eio_monitor_inotify.c +++ b/src/lib/eio/eio_monitor_inotify.c | |||
@@ -141,6 +141,9 @@ _eio_inotify_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh) | |||
141 | if ((event_size + i) > size) break ; | 141 | if ((event_size + i) > size) break ; |
142 | i += event_size; | 142 | i += event_size; |
143 | 143 | ||
144 | // No need to waste time looking up for just destroyed handler | ||
145 | if ((event->mask & IN_IGNORED)) continue ; | ||
146 | |||
144 | backend = eina_hash_find(_inotify_monitors, &event->wd); | 147 | backend = eina_hash_find(_inotify_monitors, &event->wd); |
145 | if (!backend) continue ; | 148 | if (!backend) continue ; |
146 | if (!backend->parent) continue ; | 149 | if (!backend->parent) continue ; |
@@ -268,6 +271,8 @@ void eio_monitor_backend_del(Eio_Monitor *monitor) | |||
268 | monitor->backend = NULL; | 271 | monitor->backend = NULL; |
269 | if (!backend) return; | 272 | if (!backend) return; |
270 | 273 | ||
274 | backend->parent = NULL; | ||
275 | |||
271 | eina_hash_del(_inotify_monitors, &backend->hwnd, backend); | 276 | eina_hash_del(_inotify_monitors, &backend->hwnd, backend); |
272 | } | 277 | } |
273 | 278 | ||