Skip to content

Commit

Permalink
Fix TextPacket vulnerability
Browse files Browse the repository at this point in the history
Fixed by: mc-zone.ru
  • Loading branch information
mopsikzlo authored Jan 14, 2024
1 parent 1015502 commit 03879b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/TextPacket.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ protected function decodePayload(PacketSerializer $in) : void{
case self::TYPE_JUKEBOX_POPUP:
$this->message = $in->getString();
$count = $in->getUnsignedVarInt();
if ($count > 5){
throw new PacketDecodeException("Too many TextPacket::TYPE_JUKEBOX_POPUP");
}
for($i = 0; $i < $count; ++$i){
$this->parameters[] = $in->getString();
}
Expand Down

0 comments on commit 03879b4

Please sign in to comment.