--- KademliaUDPListener.cpp~ 2008-08-01 19:31:00.000000000 +0200 +++ KademliaUDPListener.cpp 2008-11-28 01:37:34.000000000 +0100 @@ -512,6 +512,12 @@ *puOutContactID = uID; uint16 uTCPPort = byteIO.ReadUInt16(); uint8 uVersion = byteIO.ReadByte(); + if (uVersion == 0) + { + CString strError; + strError.Format(_T("***NOTE: Received invalid Kademlia2 version (%u) in %hs"), uVersion, __FUNCTION__); + throw strError; + } if (pnOutVersion != NULL) *pnOutVersion = uVersion; @@ -527,7 +533,11 @@ if (pTag->IsInt() && (uint16)pTag->GetInt() > 0) uUDPPort = (uint16)pTag->GetInt(); else - ASSERT( false ); + { + CString strError; + strError.Format(_T("***NOTE: Received invalid port (zero or non-integer) in %hs"), __FUNCTION__); + throw strError; + } } if (!pTag->m_name.Compare(TAG_KADMISCOPTIONS)) @@ -543,8 +553,9 @@ ASSERT( false ); } } - else - ASSERT( false ); + // Just ignore silently invalid KadMiscOptions + //else + // ASSERT( false ); } delete pTag;
There has been reports [1][2] for aMule that these assertions were triggered.