Skip to content

Commit 1db1dfc

Browse files
committed
fixup! Bound decoder work to prevent a pointer fan-out denial of service
1 parent 5d63b00 commit 1db1dfc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/MaxMind/Db/Test/Reader/DecoderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,16 +450,16 @@ public function testPointerFanOutIsBounded(): void
450450

451451
public function testMapPointerFanOutIsBounded(): void
452452
{
453-
// Each map has two scalar keys whose values point to the map below.
453+
// Each map has two distinct UTF-8 keys whose values point to the map below.
454454
// This makes the decoder visit the shared target twice per layer while
455455
// keeping the fixture itself small.
456456
$depth = 100;
457457
$buf = "\xa0"; // leaf: uint16 with value 0
458458
$prev = 0;
459459
for ($i = 0; $i < $depth; ++$i) {
460460
$offset = \strlen($buf);
461-
$buf .= "\xe2\xa0" . $this->encodePointer1($prev)
462-
. "\xa0" . $this->encodePointer1($prev);
461+
$buf .= "\xe2\x41a" . $this->encodePointer1($prev)
462+
. "\x41b" . $this->encodePointer1($prev);
463463
$prev = $offset;
464464
}
465465

0 commit comments

Comments
 (0)