mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-16 22:35:06 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
3339225fe8 | |||
df33e179e5 | |||
624a7dff16 |
@ -113,3 +113,9 @@ Released 19th April 2022.
|
||||
|
||||
## Fixes
|
||||
- Fixed several potential crashes when deserializing item NBT (due to insufficient validation of input data).
|
||||
|
||||
# 4.2.10
|
||||
Released 20th April 2022.
|
||||
|
||||
## Fixes
|
||||
- Fixed performance issue when chat messages received from the client contain many newlines. This security vulnerability was disclosed publicly necessitating a priority fix.
|
||||
|
@ -31,7 +31,7 @@ use function str_repeat;
|
||||
|
||||
final class VersionInfo{
|
||||
public const NAME = "PocketMine-MP";
|
||||
public const BASE_VERSION = "4.2.9";
|
||||
public const BASE_VERSION = "4.2.10";
|
||||
public const IS_DEVELOPMENT_BUILD = false;
|
||||
public const BUILD_CHANNEL = "stable";
|
||||
|
||||
|
@ -1377,8 +1377,14 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
public function chat(string $message) : bool{
|
||||
$this->removeCurrentWindow();
|
||||
|
||||
//Fast length check, to make sure we don't get hung trying to explode MBs of string ...
|
||||
$maxTotalLength = $this->messageCounter * (self::MAX_CHAT_BYTE_LENGTH + 1);
|
||||
if(strlen($message) > $maxTotalLength){
|
||||
return false;
|
||||
}
|
||||
|
||||
$message = TextFormat::clean($message, false);
|
||||
foreach(explode("\n", $message) as $messagePart){
|
||||
foreach(explode("\n", $message, $this->messageCounter + 1) as $messagePart){
|
||||
if(trim($messagePart) !== "" && strlen($messagePart) <= self::MAX_CHAT_BYTE_LENGTH && mb_strlen($messagePart, 'UTF-8') <= self::MAX_CHAT_CHAR_LENGTH && $this->messageCounter-- > 0){
|
||||
if(strpos($messagePart, './') === 0){
|
||||
$messagePart = substr($messagePart, 1);
|
||||
|
Reference in New Issue
Block a user