From 9660724387130d461dea14ff565648ae69b67f40 Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Thu, 31 Mar 2011 10:49:33 +0000 Subject: [PATCH] - make get() return false if the SSH_FXP_READ packet failed git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@150 21d32557-59b3-4da0-833f-c5933fad653e --- phpseclib/Net/SFTP.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index f29b2660..06898d7c 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -1230,6 +1230,11 @@ class Net_SFTP extends Net_SSH2 { return false; } + // check the status from the NET_SFTP_STATUS case in the above switch after the file has been closed + if ($status != NET_SFTP_STATUS_OK) { + return false' + } + extract(unpack('Nstatus', $this->_string_shift($response, 4))); if ($status != NET_SFTP_STATUS_OK) { extract(unpack('Nlength', $this->_string_shift($response, 4)));