diff --git a/phpseclib/System/SSH/Agent.php b/phpseclib/System/SSH/Agent.php index 519a60f6..4ca34d4c 100644 --- a/phpseclib/System/SSH/Agent.php +++ b/phpseclib/System/SSH/Agent.php @@ -321,7 +321,9 @@ class System_SSH_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) {