Sophie

Sophie

distrib > Mageia > 2 > i586 > by-pkgid > 1e531386b1524e1d547ff22db743e9d0 > files > 5

libvmime-0.9.1-1.mga2.src.rpm

diff -Nurb libvmime-0.8.1.orig/src/parameter.cpp libvmime-0.8.1.patched/src/parameter.cpp
--- libvmime-0.8.1.orig/src/parameter.cpp	2007-12-12 22:56:06.370906150 +0100
+++ libvmime-0.8.1.patched/src/parameter.cpp	2007-12-12 22:48:52.031761651 +0100
@@ -268,7 +268,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])
 		{