diff options
author | Halil Pasic <pasic@linux.vnet.ibm.com> | 2017-03-02 19:13:08 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2017-03-29 02:35:23 +0300 |
commit | aa262928595d431bfee7914cb7d9d79197f887a2 (patch) | |
tree | 8dfbad003754d9e9707f272609c656c248ab842a /util/event_notifier-win32.c | |
parent | df9046363220e57d45818312759b954c033c58ab (diff) |
event_notifier: prevent accidental use after close
Let's set the handles to the underlying facilities to their extremal
value so no accidental misuse can happen, and to make it obvious that the
notifier is dysfunctional. E.g. if we just close an fd but do not touch
the int holding the fd eventually a read/write could succeed again when
the fd gets reused, and corrupt the file addressed by the fd.
Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'util/event_notifier-win32.c')
-rw-r--r-- | util/event_notifier-win32.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/util/event_notifier-win32.c b/util/event_notifier-win32.c index 519fb59123..62c53b0a99 100644 --- a/util/event_notifier-win32.c +++ b/util/event_notifier-win32.c @@ -25,6 +25,7 @@ int event_notifier_init(EventNotifier *e, int active) void event_notifier_cleanup(EventNotifier *e) { CloseHandle(e->event); + e->event = NULL; } HANDLE event_notifier_get_handle(EventNotifier *e) |