From 9a7d6cdb545bae0cd90fd2f0d9e7a8a67b7eedc5 Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Tue, 24 Apr 2012 05:01:55 +0000 Subject: [PATCH] - add !is_resource() check git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@216 21d32557-59b3-4da0-833f-c5933fad653e --- phpseclib/Net/SSH2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index a37922ed..276770be 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1900,7 +1900,7 @@ class Net_SSH2 { */ function _get_binary_packet() { - if (feof($this->fsock)) { + if (!is_resource($this->fsock) || feof($this->fsock)) { user_error('Connection closed prematurely', E_USER_NOTICE); return false; } @@ -2215,7 +2215,7 @@ class Net_SSH2 { */ function _send_binary_packet($data) { - if (feof($this->fsock)) { + if (!is_resource($this->fsock) || feof($this->fsock)) { user_error('Connection closed prematurely', E_USER_NOTICE); return false; }