Fix bounds check (#1071)

Fix Chat Crash

Update CMakeVariables.txt

Add checks for all servers
This commit is contained in:
David Markowitz
2023-05-06 11:32:53 -07:00
committed by GitHub
parent 7949907517
commit 33c12f3bc5
4 changed files with 7 additions and 1 deletions

View File

@@ -171,6 +171,8 @@ dLogger* SetupLogger() {
}
void HandlePacket(Packet* packet) {
if (packet->length < 4) return;
if (packet->data[0] == ID_USER_PACKET_ENUM) {
if (static_cast<eConnectionType>(packet->data[1]) == eConnectionType::SERVER) {
if (static_cast<eServerMessageType>(packet->data[3]) == eServerMessageType::VERSION_CONFIRM) {