From deb485c0e1e32de4408d3d5e69ab64366abc7ff8 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 5 Sep 2017 21:59:51 -0500 Subject: [PATCH] SFTP: fix put() with remote file stream resource (#1177) --- phpseclib/Net/SFTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 116e7e49..a0b36323 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -2036,7 +2036,7 @@ class Net_SFTP extends Net_SSH2 if (isset($fp)) { $stat = fstat($fp); - $size = $stat['size']; + $size = !empty($stat) ? $stat['size'] : 0; if ($local_start >= 0) { fseek($fp, $local_start);