- add !is_resource() check

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@216 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
Jim Wigginton 2012-04-24 05:01:55 +00:00
parent da8614a511
commit 9a7d6cdb54

View File

@ -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;
}