From 49cc5dc40af4beaf89c39e3dea2c15893c84fb56 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sun, 19 Jun 2011 17:51:33 +0000 Subject: [PATCH] Fixed parsing of an attachment filename that is between 66 and 76 characters long (Zarafa). --- src/parameter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parameter.cpp b/src/parameter.cpp index 91a7e5c4..f59d5abe 100644 --- a/src/parameter.cpp +++ b/src/parameter.cpp @@ -281,7 +281,8 @@ void parameter::generate(utility::outputStream& os, const string::size_type maxL 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]) {