diff --git a/phpseclib/System/SSH/Agent.php b/phpseclib/System/SSH/Agent.php index 23ef69e5..ae465377 100644 --- a/phpseclib/System/SSH/Agent.php +++ b/phpseclib/System/SSH/Agent.php @@ -169,7 +169,9 @@ class Agent $length = current(unpack('N', fread($this->fsock, 4))); $key_blob = fread($this->fsock, $length); $length = current(unpack('N', fread($this->fsock, 4))); - $key_comment = fread($this->fsock, $length); + if ($length) { + $key_comment = fread($this->fsock, $length); + } $length = current(unpack('N', substr($key_blob, 0, 4))); $key_type = substr($key_blob, 4, $length); switch ($key_type) {