From bacfb3151eb26731b0f40f47aeff0860f1cafde8 Mon Sep 17 00:00:00 2001
From: Image <image.emagi@gmail.com>
Date: Thu, 20 May 2021 09:52:07 -0400
Subject: [PATCH] fix for bad handling of EQProtocolPacket creation

---
 EQ2/source/common/EQStream.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/EQ2/source/common/EQStream.cpp b/EQ2/source/common/EQStream.cpp
index 50c1a21ff..3df6c5da4 100644
--- a/EQ2/source/common/EQStream.cpp
+++ b/EQ2/source/common/EQStream.cpp
@@ -300,6 +300,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p, EQProtocolPacket* lastp)
 							ProcessPacket(subp, p);
 							delete subp;
 						}
+						else
+						{
+							printf("!!!!!!!!!Garbage Packet Unknown!!!!!!!!!!!!!\n");
+							DumpPacket(p->pBuffer + processed + offset, subpacket_length);
+						}
+						
 						if(prevPacket)
 						{
 							printf("prevPacketSize: %u\n", prevPacket->size);
@@ -1642,7 +1648,7 @@ DumpPacket(buffer, length);
 		DumpPacket(buffer, newlength);
 #endif
 		uint16 opcode=ntohs(*(const uint16 *)newbuffer);
-		if(opcode <= OP_OutOfSession)
+		if(opcode > 0 && opcode <= OP_OutOfSession)
 		{
 			EQProtocolPacket p(newbuffer,newlength);
 			ProcessPacket(&p);