From dc07435002da3503f75f4e242bbb29eaef7dfbf7 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Mon, 18 Jan 2016 14:36:25 +0100 Subject: [PATCH] Fix closefrom(2) infinite loop. --- kernel/dtable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/dtable.cpp b/kernel/dtable.cpp index 6929b517..039332de 100644 --- a/kernel/dtable.cpp +++ b/kernel/dtable.cpp @@ -1,6 +1,6 @@ /******************************************************************************* - Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014, 2015. + Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014, 2015, 2016. This file is part of Sortix. @@ -301,7 +301,7 @@ int DescriptorTable::CloseFrom(int index) return errno = EBADF, -1; ScopedLock lock(&dtablelock); bool any = false; - while ( index < numentries ) + for ( ; index < numentries; index++ ) { if ( !IsGoodEntry(index) ) continue;