Revision: 95
http://svn.sourceforge.net/nmailserver/?rev=95&view=rev
Author: tmyroadctfig
Date: 2006-12-03 05:05:48 -0800 (Sun, 03 Dec 2006)
Log Message:
-----------
Fixed a defect parsing MIME messages (Bug #1607841).
Modified Paths:
--------------
NMail/trunk/NMail/Helper/MimeHelper.cs
Modified: NMail/trunk/NMail/Helper/MimeHelper.cs
===================================================================
--- NMail/trunk/NMail/Helper/MimeHelper.cs 2006-11-26 06:28:09 UTC (rev 94)
+++ NMail/trunk/NMail/Helper/MimeHelper.cs 2006-12-03 13:05:48 UTC (rev 95)
@@ -57,16 +57,17 @@
preamble = new MessageDataPart(data);
break;
- } else {
+ } else if (boundaryOffset > 0) {
// Extract the preamble
preamble = new MessageDataPart(data.SubString(0, boundaryOffset - Message.Terminator.Length));
+ }
- // Find the end of the boundary line and move to the next block
- int terminatorOffset =
- data.IndexOf(Message.Terminator, boundaryOffset + boundary.Length);
- blockStartOffset = terminatorOffset + Message.Terminator.Length;
- inPreamble = false;
- }
+ // Find the end of the boundary line and move to the next block
+ int terminatorOffset =
+ data.IndexOf(Message.Terminator, boundaryOffset + boundary.Length);
+ blockStartOffset = terminatorOffset + Message.Terminator.Length;
+ inPreamble = false;
+
} else {
boundaryOffset = data.IndexOf(boundary, blockStartOffset);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|