fix potential UB in decompression

This commit is contained in:
Lion Kortlepel 2024-06-23 23:04:55 +02:00
parent f94b9adf7a
commit b034072027
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B

View File

@ -51,9 +51,11 @@ void UDPParser(std::string_view Packet) {
if (Packet.substr(0, 4) == "ABG:") {
auto substr = Packet.substr(4);
auto res = DeComp(std::span<const char>(substr.data(), substr.size()));
Packet = std::string(res.data(), res.size());
std::string DeCompPacket = std::string(res.data(), res.size());
ServerParser(DeCompPacket);
} else {
ServerParser(Packet);
}
ServerParser(Packet);
}
void UDPRcv() {
sockaddr_in FromServer {};