summaryrefslogtreecommitdiff
path: root/libraries/libvmime-zarafa/zarafa-patches/vmime-attachfnamelen.diff
blob: 6de58db5f557884d9ad873212464ab2c2055afa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
diff -urN libvmime-0.7.1-pristine/src/defaultParameter.cpp libvmime-0.7.1/src/defaultParameter.cpp
--- libvmime-0.7.1-pristine/src/defaultParameter.cpp	2005-06-21 19:06:35.000000000 +0200
+++ libvmime-0.7.1/src/defaultParameter.cpp	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])
 		{