From: Donald Sharp Date: Wed, 1 Aug 2018 19:07:07 +0000 (-0400) Subject: lib: Ensure read/write fd's are in range X-Git-Tag: frr-6.1-dev~111^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=9b864cd3cddb6593909bd1367025e2d3448ae6b6;p=matthieu%2Ffrr.git lib: Ensure read/write fd's are in range Ensure that we can properly handle a passed in read/write fd for using in poll. Signed-off-by: Donald Sharp --- diff --git a/lib/thread.c b/lib/thread.c index 1c5e838772..898e9e9fce 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -782,6 +782,7 @@ struct thread *funcname_thread_add_read_write(int dir, struct thread_master *m, { struct thread *thread = NULL; + assert(fd >= 0 && fd < m->fd_limit); pthread_mutex_lock(&m->mtx); { if (t_ptr