mirror of
https://github.com/nzbget/nzbget.git
synced 2025-12-23 22:27:45 -05:00
#745: fixed crash caused by malformed nzb files
: for file elements not having subject attribute a (somewhat) random subject is generated and is used as file name; correct file names are read from articles later anyway
This commit is contained in:
@@ -117,6 +117,12 @@ void NzbFile::ParseSubject(FileInfo* fileInfo, bool TryQuotes)
|
||||
{
|
||||
// Example subject: some garbage "title" yEnc (10/99)
|
||||
|
||||
if (!fileInfo->GetSubject())
|
||||
{
|
||||
// Malformed file element without subject. We generate subject using internal element id.
|
||||
fileInfo->SetSubject(CString::FormatStr("%d", fileInfo->GetId()));
|
||||
}
|
||||
|
||||
// strip the "yEnc (10/99)"-suffix
|
||||
BString<1024> subject = fileInfo->GetSubject();
|
||||
char* end = subject + strlen(subject) - 1;
|
||||
|
||||
Reference in New Issue
Block a user