diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index ec742954..cd651ae8 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -1913,7 +1913,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; } }