Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > e548512dcc847653815f1b7adc710b15 > files > 5

libvmime07-0.7.1-4.fc13.src.rpm

Patch by Zarafa <http://www.zarafa.com/> - fixes parsing of an attachment filename that is between 66 and
76 characters long.

--- libvmime-0.7.1/src/defaultParameter.cpp				2005-06-21 19:06:35.000000000 +0200
+++ libvmime-0.7.1/src/defaultParameter.cpp.attachfnamelen		2006-08-01 10:42:18.277853120 +0200
@@ -200,7 +200,8 @@
 	bool needQuoting = false;
 	string::size_type valueLength = 0;
 
-	for (string::size_type i = 0 ; (i < value.length()) && (pos + valueLength < maxLineLength - 4) ; ++i, ++valueLength)
+	// Use worst-case length name.length()+2 for 'name=' part of line
+	for (string::size_type i = 0 ; (i < value.length()) && (pos + name.length() + 2 + valueLength < maxLineLength - 4) ; ++i, ++valueLength)
 	{
 		switch (value[i])
 		{