Update of /cvsroot/mahogany/M/src/modules/viewflt
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11495/src/modules/viewflt

Modified Files:
        UUDecode.cpp 
Log Message:
check that uuencoded text is really terminated by end and not by end followed by 
anything

Index: UUDecode.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/viewflt/UUDecode.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -b -u -2 -r1.7 -r1.8
--- UUDecode.cpp        16 May 2004 11:55:33 -0000      1.7
+++ UUDecode.cpp        16 May 2004 11:59:27 -0000      1.8
@@ -156,5 +156,5 @@
 
 // UUencoded data ends at a line consisting solely of "end"
-#define UU_END_PREFIX _T("\r\nend")
+#define UU_END_PREFIX _T("\r\nend\r\n")
 
 // ============================================================================
@@ -274,5 +274,8 @@
    delete[] buffer;
    if (decodedBytesInLine < 0)
+   {
+      wxLogWarning(_("Invalid character in uuencoded text."));
       return false;
+   }
 
    decodedFile.Shrink();
@@ -351,5 +354,6 @@
       String decodedFile;
       const wxChar* endOfEncodedStream = 0;
-      if ( UUdecodeFile(start_data, decodedFile, &endOfEncodedStream) )
+      bool ok = UUdecodeFile(start_data, decodedFile, &endOfEncodedStream);
+      if ( ok )
       {
          static const size_t lenEnd = wxStrlen(UU_END_PREFIX);
@@ -358,5 +362,13 @@
             endOfEncodedStream += lenEnd;
          }
+         else
+         {
+            wxLogError(_("No \"end\" line at the end of uuencoded text."));
+            ok = false;
+         }
+      }
 
+      if ( ok )
+      {
          // output the part before the BEGIN line, if any
          String prolog(nextToOutput, startBeginLine - lenEOL);
@@ -385,5 +397,5 @@
       else
       {
-         wxLogWarning(_("This message seems to contain uuencoded data, but in fact it 
does not."));
+         wxLogWarning(_("Corrupted message with uuencoded attachment."));
       }
    }



-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to