diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index c2d6110a..0706fde3 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -1916,7 +1916,7 @@ class SFTP extends SSH2 } } else { $temp = isset($fp) ? fread($fp, $sftp_packet_size) : substr($data, $sent, $sftp_packet_size); - if ($temp === false) { + if ($temp === false || $temp === '') { break; } }