error on string OOB

This commit is contained in:
Lion Kortlepel
2020-11-11 11:01:48 +01:00
parent f6166460ff
commit 5d91c5fde5

View File

@@ -44,6 +44,10 @@ void TCPSend(const std::string&Data){
Sent = 0;
Size += 4;
do{
if (size_t(Sent) >= Send.size()) {
error(Sec("string OOB in ") + std::string(__func__));
return;
}
Temp = send(TCPSock, &Send[Sent], Size - Sent, 0);
if(!CheckBytes(Temp))return;
Sent += Temp;