mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Fixes nasty bug in event processing.
WALK_LIST_DELSAFE (in ev_run_list) is not safe with regard to deletion of next node. When some events are rescheduled during event execution, it may lead to deletion of next node and some events are skipped. Such skipped nodes remain in temporary list on stack and the last of them contains 'next' pointer to stack area. When this event is later scheduled, it damages stack area trying to remove it from the list, which leads to random crashes with funny backtraces :-) .
This commit is contained in:
@@ -125,13 +125,13 @@ ev_schedule(event *e)
|
||||
int
|
||||
ev_run_list(event_list *l)
|
||||
{
|
||||
node *n, *p;
|
||||
node *n;
|
||||
list tmp_list;
|
||||
|
||||
init_list(&tmp_list);
|
||||
add_tail_list(&tmp_list, l);
|
||||
init_list(l);
|
||||
WALK_LIST_DELSAFE(n, p, tmp_list)
|
||||
WALK_LIST_FIRST(n, tmp_list)
|
||||
{
|
||||
event *e = SKIP_BACK(event, n, n);
|
||||
ev_run(e);
|
||||
|
Reference in New Issue
Block a user