Verify OP_Ack size & fix crash in BasePacket::build_raw_header_dump due to uninitialised timestamp

This commit is contained in:
Derision 2013-04-27 15:45:24 +01:00
parent 61f7009378
commit 401e897019
3 changed files with 9 additions and 0 deletions

View File

@ -1,6 +1,9 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 04/27/2013 ==
Pixel Bounds: Verify OP_Ack size & fix crash in BasePacket::build_raw_header_dump due to uninitialised timestamp.
== 04/24/2013 ==
Bad_Captain: Fixed a couple of merc stat issues.
Bad_Captain: Removed unneeded bot pet AI.

View File

@ -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];

View File

@ -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);