If the (pfd->revents & POLLNVAL) case is triggered,
we do DLIST_REMOVE(ev->fd_events, fde); and then
use fde->next in the loop above.
Save off fde->next for loop interation before
this so we can't use a deleted ->next value.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11771
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit
2be3dd1407eabe3df360ede2eab178848e34733c)
int timeout = -1;
int poll_errno;
struct tevent_fd *fde = NULL;
+ struct tevent_fd *next = NULL;
unsigned i;
if (ev->signal_events && tevent_common_check_signal(ev)) {
which ones and call the handler, being careful to allow
the handler to remove itself when called */
- for (fde = ev->fd_events; fde; fde = fde->next) {
+ for (fde = ev->fd_events; fde; fde = next) {
uint64_t idx = fde->additional_flags;
struct pollfd *pfd;
uint16_t flags = 0;
+ next = fde->next;
+
if (idx == UINT64_MAX) {
continue;
}