# HG changeset patch # User Matt Johnston # Date 1117752798 0 # Node ID 1a52846ec11fdd5ff7ca7ddeea5e62f160c7de05 # Parent 85cc531f711e4d2a5fe1103308dd0d72917730db * fix off-by-one closing open FDs diff -r 85cc531f711e -r 1a52846ec11f svr-chansession.c --- a/svr-chansession.c Thu Jun 02 16:21:58 2005 +0000 +++ b/svr-chansession.c Thu Jun 02 22:53:18 2005 +0000 @@ -837,7 +837,7 @@ /* close file descriptors except stdin/stdout/stderr * Need to be sure FDs are closed here to avoid reading files as root */ - for (i = 3; i < (unsigned int)ses.maxfd; i++) { + for (i = 3; i <= (unsigned int)ses.maxfd; i++) { if (m_close(i) == DROPBEAR_FAILURE) { dropbear_exit("Error closing file desc"); }