fix potential UB in decompression

This commit is contained in:
Lion Kortlepel
2024-06-23 23:04:55 +02:00
parent f94b9adf7a
commit b034072027

View File

@@ -51,10 +51,12 @@ 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);
}
}
void UDPRcv() {
sockaddr_in FromServer {};
#if defined(_WIN32)