mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-17 10:45:11 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
281cfcdcea
@ -305,7 +305,7 @@ class ASN1
|
||||
$newcontent = array();
|
||||
$remainingLength = $length;
|
||||
while ($remainingLength > 0) {
|
||||
$temp = $this->_decode_ber($content, $start);
|
||||
$temp = $this->_decode_ber($content, $start, $content_pos);
|
||||
$length = $temp['length'];
|
||||
// end-of-content octets - see paragraph 8.1.5
|
||||
if (substr($content, $content_pos + $length, 2) == "\0\0") {
|
||||
|
@ -289,4 +289,14 @@ class Unit_File_ASN1Test extends PhpseclibTestCase
|
||||
$this->assertInternalType('array', $decoded);
|
||||
$this->assertCount(0, $decoded[0]['content']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group github1027
|
||||
*/
|
||||
public function testInfiniteLoop()
|
||||
{
|
||||
$asn1 = new File_ASN1();
|
||||
$data = base64_decode('MD6gJQYKKwYBBAGCNxQCA6AXDBVvZmZpY2VAY2VydGRpZ2l0YWwucm+BFW9mZmljZUBjZXJ0ZGlnaXRhbC5ybw==');
|
||||
$asn1->decodeBER($data);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user