From 7f45bb22f550ec0394546f7e8b13d4088a564780 Mon Sep 17 00:00:00 2001 From: Andrey Prygunkov Date: Wed, 13 Feb 2008 23:27:12 +0000 Subject: [PATCH] fixed seg.fault in uulib-decoder on files in UU-format --- Decoder.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Decoder.cpp b/Decoder.cpp index bbfa9111..59647c9c 100644 --- a/Decoder.cpp +++ b/Decoder.cpp @@ -152,7 +152,7 @@ Decoder::EStatus UULibDecoder::Execute() } else { - //f**k, multiple attachments!? Can't handle this. + // multiple attachments!? Can't handle this. attachment = NULL; break; } @@ -162,7 +162,7 @@ Decoder::EStatus UULibDecoder::Execute() if (attachment) { // okay, we got only one attachment, perfect! - if ((attachment->haveparts) && (attachment->haveparts[0])) // && (!attachment->haveparts[1])) FUCK UULIB + if ((attachment->haveparts) && (attachment->haveparts[0])) // && (!attachment->haveparts[1])) { int r = UUDecodeFile(attachment, (char*)m_szDestFilename); @@ -170,7 +170,10 @@ Decoder::EStatus UULibDecoder::Execute() { // we did it! res = eFinished; - m_szArticleFilename = strdup(attachment->filename); + if (attachment->filename) + { + m_szArticleFilename = strdup(attachment->filename); + } } } else