Hello!
Just popped in to say, that there is a bug somewhere in function CUpDownClient:: ProcessMuleCommentPacket in file BaseClient.cpp. The function try'es and catches if there is a 'reqfile' pointer, but something goes wrong and amule crashes if there is a malformed MuleCommentPacket. I've got several full crashes on this problem. Code snippet follows:
void CUpDownClient::ProcessMuleCommentPacket(char* pachPacket, uint32 nSize)
{
try
{
if (!reqfile) {
throw CInvalidPacket("comment packet for unknown file");
}
CSafeMemFile data((BYTE*)pachPacket,nSize);
int length;
if ( sizeof(m_iRate) != data.Read(&m_iRate,sizeof(m_iRate)) )
throw CInvalidPacket("short packet reading rating");
if ( sizeof(length) != data.Read(&length,sizeof(length)) )
throw CInvalidPacket("short packet reading comment length");
reqfile->SetHasRating(true);
theApp.amuledlg->AddDebugLogLine(false,_("Rating for file '%s' received: %i"),m_pszClientFilename,m_iRate);
if (length>50) length=50;
if (length>0){
char* desc=new char[length+1];
memset(desc,0,length+1);
if ( (unsigned int)length != data.Read(desc,length) )
throw CInvalidPacket("short packet reading comment string");
theApp.amuledlg->AddDebugLogLine(false,_("Description for file '%s' received: %s"), m_pszClientFilename, desc);
m_strComment.Format("%s",desc);
reqfile->SetHasComment(true);
delete[] desc;
}
}
catch ( CInvalidPacket e )
{
printf("Invalid MuleComment packet - %s\n", e.what());
return;
}
if (reqfile->HasRating() || reqfile->HasComment()) theApp.amuledlg->transferwnd->downloadlistctrl->UpdateItem(reqfile);
}