Commit 0f5054f6 authored by Pavel Tvrdik's avatar Pavel Tvrdik Committed by Ondřej Zajíček

BFD: Fix invalid read from pollfd array

It is possible that sockets_add() are called between sockets_prepare()
and sockets_fire() during poll loop in birdloop_main(), so we need to
use loop->poll_fd.used instead of loop->sock_num to find the last field.
parent a290da25
......@@ -589,7 +589,7 @@ sockets_fire(struct birdloop *loop)
times_update(loop);
/* Last fd is internal wakeup fd */
if (pfd[loop->sock_num].revents & POLLIN)
if (pfd[poll_num].revents & POLLIN)
wakeup_drain(loop);
int i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment