Sun, 08 May 2022 11:52:52 +0200
fix invalid memory access in event_bsd.c
src/server/daemon/event_bsd.c | file | annotate | diff | comparison | revisions |
--- a/src/server/daemon/event_bsd.c Sun May 08 10:46:56 2022 +0200 +++ b/src/server/daemon/event_bsd.c Sun May 08 11:52:52 2022 +0200 @@ -92,6 +92,7 @@ continue; } + int event_events = event->events; if(event->fn) { int saved_ev = event->events; @@ -102,12 +103,14 @@ event->finish(ev, event); } - event->events = 0; + event_events = 0; + } else { + event_events = event->events; } // if events have changed, we need to add/remove filters - if(saved_ev != event->events) { - int e = event->events; + if(saved_ev != event_events) { + int e = event_events; int e_fd = events[i].ident; if((e & EVENT_POLLIN) != (saved_ev & EVENT_POLLIN)) { if((e & EVENT_POLLIN) == EVENT_POLLIN) {