From f8eb4b7edcf843593d640a14761d1ac017401be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Tue, 30 Mar 2021 08:23:49 -0400 Subject: [PATCH] fix(net): prevent gibberish padding on linux --- src/network/room.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/room.cpp b/src/network/room.cpp index 90d6d08dca..cd0c0ebc49 100644 --- a/src/network/room.cpp +++ b/src/network/room.cpp @@ -912,7 +912,7 @@ void Room::RoomImpl::HandleChatPacket(const ENetEvent* event) { } // Limit the size of chat messages to MaxMessageSize - message.resize(MaxMessageSize); + message.resize(std::min(static_cast(message.size()), MaxMessageSize)); Packet out_packet; out_packet << static_cast(IdChatMessage);