diff svr-chansession.c @ 208:1a52846ec11f

* fix off-by-one closing open FDs
author Matt Johnston <matt@ucc.asn.au>
date Thu, 02 Jun 2005 22:53:18 +0000
parents 675f7bf3c391
children c5d3ef11155f
line wrap: on
line diff
--- 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");
 		}