lua error fix

This commit is contained in:
Anonymous275 2020-11-11 00:40:22 +02:00
parent 60c7997c6b
commit 94f6a81673
3 changed files with 13 additions and 3 deletions

View File

@ -179,9 +179,9 @@ void Identification(SOCKET TCPSock,Hold*S,RSA*Skey){
for(auto& c : CI->Clients){
if(c != nullptr){
if(c->GetDID() == DID){
error("died on " + std::string(__func__) + ":" + std::to_string(__LINE__));
closesocket(c->GetTCPSock());
c->SetStatus(-2);
// error("died on " + std::string(__func__) + ":" + std::to_string(__LINE__));
//closesocket(c->GetTCPSock());
//c->SetStatus(-2); ////TODO: UNCOMMENT!!
break;
}
}

View File

@ -233,6 +233,9 @@ void GlobalParser(Client*c, const std::string& Pack){
void GParser(Client*c, const std::string& Packet){
Assert(c);
if(Packet.find("Zp") != std::string::npos && Packet.size() > 500){
abort();
}
#ifdef WIN32
__try{
GlobalParser(c, Packet);

View File

@ -172,6 +172,10 @@ std::string UDPRcvFromClient(sockaddr_in& client) {
#endif // WIN32
return "";
}
Ret = Ret.substr(0,Rcv);
if(Ret.find("Zp") != std::string::npos && Ret.size() > 500){
abort();
}
return Ret.substr(0,Rcv);
}
@ -221,6 +225,9 @@ void HandleChunk(Client* c, const std::string& Data) {
}
}
void UDPParser(Client* c, std::string Packet) {
if(Packet.find("Zp") != std::string::npos && Packet.size() > 500){
abort();
}
Assert(c);
if (Packet.substr(0, 4) == "ABG:") {
Packet = DeComp(Packet.substr(4));