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.
This commit is contained in:
parent
a290da25a1
commit
0f5054f685
1 changed files with 1 additions and 1 deletions
|
@ -589,7 +589,7 @@ sockets_fire(struct birdloop *loop)
|
||||||
times_update(loop);
|
times_update(loop);
|
||||||
|
|
||||||
/* Last fd is internal wakeup fd */
|
/* Last fd is internal wakeup fd */
|
||||||
if (pfd[loop->sock_num].revents & POLLIN)
|
if (pfd[poll_num].revents & POLLIN)
|
||||||
wakeup_drain(loop);
|
wakeup_drain(loop);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
Loading…
Reference in a new issue