mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Verify OP_Ack size & fix crash in BasePacket::build_raw_header_dump due to uninitialised timestamp
This commit is contained in:
@@ -28,6 +28,7 @@ BasePacket::BasePacket(const unsigned char *buf, uint32 len)
|
||||
this->size=0;
|
||||
this->_wpos = 0;
|
||||
this->_rpos = 0;
|
||||
this->timestamp.tv_sec = 0;
|
||||
if (len>0) {
|
||||
this->size=len;
|
||||
pBuffer= new unsigned char[len];
|
||||
|
||||
@@ -284,6 +284,11 @@ uint32 processed=0,subpacket_length=0;
|
||||
}
|
||||
break;
|
||||
case OP_Ack: {
|
||||
if(!p->pBuffer || (p->Size() < 4))
|
||||
{
|
||||
_log(NET__ERROR, _L "Received OP_Ack that was of malformed size" __L);
|
||||
break;
|
||||
}
|
||||
#ifndef COLLECTOR
|
||||
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
|
||||
AckPackets(seq);
|
||||
|
||||
Reference in New Issue
Block a user