From 5888c6cef64b72a41266d4158b3374a7d7ee4789 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 21 Oct 2013 15:15:31 -0500 Subject: [PATCH] SCP: if exec() failed return false immediately --- phpseclib/Net/SCP.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/phpseclib/Net/SCP.php b/phpseclib/Net/SCP.php index c9be7894..5f9517e1 100644 --- a/phpseclib/Net/SCP.php +++ b/phpseclib/Net/SCP.php @@ -170,7 +170,9 @@ class Net_SCP { return false; } - $this->ssh->exec('scp -t ' . $remote_file, false); // -t = to + if (!$this->ssh->exec('scp -t ' . $remote_file, false)) { // -t = to + return false; + } $temp = $this->_receive(); if ($temp !== chr(0)) { @@ -239,7 +241,9 @@ class Net_SCP { return false; } - $this->ssh->exec('scp -f ' . $remote_file, false); // -f = from + if (!$this->ssh->exec('scp -f ' . $remote_file, false)) { // -f = from + return false; + } $this->_send("\0");