mirror of
https://github.com/PabloMK7/citra
synced 2024-11-15 05:08:23 +00:00
fix(net): prevent gibberish padding on linux client (#5941)
This commit is contained in:
parent
327d07d66f
commit
e04d904b2b
1 changed files with 2 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
@ -380,6 +381,7 @@ void RoomMember::RoomMemberImpl::HandleChatPacket(const ENetEvent* event) {
|
||||||
packet >> chat_entry.nickname;
|
packet >> chat_entry.nickname;
|
||||||
packet >> chat_entry.username;
|
packet >> chat_entry.username;
|
||||||
packet >> chat_entry.message;
|
packet >> chat_entry.message;
|
||||||
|
chat_entry.message.resize(std::min(chat_entry.message.find('\0'), chat_entry.message.size()));
|
||||||
Invoke<ChatEntry>(chat_entry);
|
Invoke<ChatEntry>(chat_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue