]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Ensure read/write fd's are in range
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 1 Aug 2018 19:07:07 +0000 (15:07 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 1 Aug 2018 19:41:47 +0000 (19:41 +0000)
Ensure that we can properly handle a passed in read/write
fd for using in poll.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/thread.c

index 1c5e8387729774dc9bf355b47055c6a736e97383..898e9e9fced5b42285f6826e8f6da47b8a69f5ff 100644 (file)
@@ -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