mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-18 11:15:12 +00:00
Merge pull request #737 from terrafrost/limit-preg-match-1.0
SSH2: limit the size of data that expect() looks at * terrafrost/limit-preg-match-1.0: SSH2: limit the size of data that expect() looks at
This commit is contained in:
commit
6a80da4c87
@ -2670,7 +2670,7 @@ class Net_SSH2
|
|||||||
$match = $expect;
|
$match = $expect;
|
||||||
while (true) {
|
while (true) {
|
||||||
if ($mode == NET_SSH2_READ_REGEX) {
|
if ($mode == NET_SSH2_READ_REGEX) {
|
||||||
preg_match($expect, $this->interactiveBuffer, $matches);
|
preg_match($expect, substr($this->interactiveBuffer, -1024), $matches);
|
||||||
$match = isset($matches[0]) ? $matches[0] : '';
|
$match = isset($matches[0]) ? $matches[0] : '';
|
||||||
}
|
}
|
||||||
$pos = strlen($match) ? strpos($this->interactiveBuffer, $match) : false;
|
$pos = strlen($match) ? strpos($this->interactiveBuffer, $match) : false;
|
||||||
|
Loading…
Reference in New Issue
Block a user