Update packet_chat.c

This commit is contained in:
occamsaturn 2025-12-16 13:07:27 -08:00 committed by GitHub
parent 78883923e3
commit 14801fb60f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -78,12 +78,12 @@ void network_send_chat(char* message, u8 globalIndex) {
void network_receive_chat(struct Packet* p) {
u16 remoteMessageLength = 0;
char remoteMessage[500] = { 0 };
char remoteMessage[MAX_CHAT_MSG_LENGTH] = { 0 };
u8 globalIndex;
packet_read(p, &globalIndex, sizeof(u8));
packet_read(p, &remoteMessageLength, sizeof(u16));
if (remoteMessageLength >= 499) { remoteMessageLength = 499; }
if (remoteMessageLength >= MAX_CHAT_MSG_LENGTH - 1) { remoteMessageLength = MAX_CHAT_MSG_LENGTH - 1; }
packet_read(p, &remoteMessage, remoteMessageLength * sizeof(u8));
// anti spoof