瀏覽代碼

Update 'EQ2/source/common/EQStream.cpp'

fix length check to avoid buffer overflow
image 1 年之前
父節點
當前提交
d9ef43ff61
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      EQ2/source/common/EQStream.cpp

+ 1 - 1
EQ2/source/common/EQStream.cpp

@@ -283,7 +283,7 @@ bool EQStream::HandleEmbeddedPacket(EQProtocolPacket *p, int16 offset, int16 len
 			uint8 new_length = 0;
 			
 			memcpy(&new_length, p->pBuffer+offset, sizeof(int8));
-			if(new_length <= p->size) {
+			if((new_length+offset+2) == p->size) {
 				new_length -= 2;
 			EQProtocolPacket *subp=new EQProtocolPacket(p->pBuffer+offset+2, new_length, OP_Packet);
 			subp->copyInfo(p);