From 975b94c5f2f5bbb8aa455445ffb26092d01568e5 Mon Sep 17 00:00:00 2001 From: Matt Johnston <matt@ucc.asn.au> Date: Thu, 2 Jun 2005 22:53:18 +0000 Subject: [PATCH] * fix off-by-one closing open FDs --HG-- extra : convert_revision : cb23685eb24523d372c07830faea3a96e7c37917 --- svr-chansession.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svr-chansession.c b/svr-chansession.c index a040a47b..1704c6ef 100644 --- a/svr-chansession.c +++ b/svr-chansession.c @@ -837,7 +837,7 @@ static void execchild(struct ChanSess *chansess) { /* 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"); } -- GitLab