0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-10 21:28:43 +00:00

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:
Pavel Tvrdik 2016-09-08 13:45:36 +02:00 committed by Ondrej Zajicek (work)
parent a290da25a1
commit 0f5054f685

View File

@ -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;