diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index deb92e63..29a8f0f4 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1959,7 +1959,7 @@ class Net_SSH2 { while (true) { if ($mode == NET_SSH2_READ_REGEX) { preg_match($expect, $this->interactiveBuffer, $matches); - $match = $matches[0]; + $match = isset($matches[0]) ? $matches[0] : array(); } $pos = !empty($match) ? strpos($this->interactiveBuffer, $match) : false; if ($pos !== false) {