From 9b864cd3cddb6593909bd1367025e2d3448ae6b6 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 1 Aug 2018 15:07:07 -0400 Subject: [PATCH] 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 --- lib/thread.c | 1 + 1 file changed, 1 insertion(+) 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 -- 2.39.5