uloop: rework event processing, fix use-after-free issues
authorFelix Fietkau <nbd@openwrt.org>
Tue, 11 Jun 2013 10:21:09 +0000 (12:21 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 11 Jun 2013 10:55:21 +0000 (12:55 +0200)
commitae40b6613019f02e856b4b1ccc2712984506152e
tree19ab6fa2ae74eba1b071cbae4e6dc832f3556305
parente5032709b29eb42568c3937a533898728a15efa1
uloop: rework event processing, fix use-after-free issues

Recursive calls to uloop_run() need to process already fetched events
first, before running kqueue/epoll to get more.

The state of cur_fd/cur_nfds and the event list needs to be maintained
properly to prevent accidental running of events pointing at deleted
uloop_fd structs.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
uloop.c