Skip to content

Commit

Permalink
Test edge cases when unpacking map keys
Browse files Browse the repository at this point in the history
  • Loading branch information
rybakit committed Feb 16, 2022
1 parent d3d3f61 commit fc6bc45
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/Unit/BufferUnpackerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public function provideInsufficientData() : array
'int64' => ["\xd3"],
'float32' => ["\xca"],
'float64' => ["\xcb"],
'mapkey' => ["\xdf\x00\x00\x00\x01"],
'mapkey_uint64' => ["\xdf\x00\x00\x00\x01\xcf"],
'fixext1' => ["\xd4"],
'fixext1t' => ["\xd4\x01"],
'fixext2' => ["\xd5"],
Expand Down Expand Up @@ -675,6 +677,9 @@ public function provideMapWithInvalidKeyData() : iterable
yield ["\x81{$packed}\x00", $type]; // [$raw => 0]
}
}

// unknown key type
yield ["\x81\xc1\x00", '0xc1'];
}

public function testOverflowedUint64MapKeyIsConvertedToString() : void
Expand Down

0 comments on commit fc6bc45

Please sign in to comment.