changeset 1565:249814876c3a

cherry-picked fixes for package vmime
author Mark Brand <mabrand@mabrand.nl>
date Tue, 25 Jan 2011 00:24:33 +0100
parents 7b4b58355124
children b5ba69a92502
files src/vmime-1-fixes.patch
diffstat 1 files changed, 56 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/vmime-1-fixes.patch	Mon Jan 24 16:04:42 2011 +0100
+++ b/src/vmime-1-fixes.patch	Tue Jan 25 00:24:33 2011 +0100
@@ -44,7 +44,7 @@
 From c6f077e695b75d9ff9a32d1621f6a320c8ce70f1 Mon Sep 17 00:00:00 2001
 From: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
 Date: Tue, 30 Nov 2010 14:57:03 +0000
-Subject: [PATCH 1/4] Initialize and delete object.
+Subject: [PATCH 1/5] Initialize and delete object.
 
 git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@577 5301114d-f842-0410-bbdd-996ee0417009
 
@@ -78,7 +78,7 @@
 From 41203315eacf53230dd7bdb0cf2b0d1078ddee39 Mon Sep 17 00:00:00 2001
 From: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
 Date: Wed, 8 Dec 2010 08:52:54 +0000
-Subject: [PATCH 2/4] No extra space between ':' and '<' in MAIL FROM and RCPT TO. Wait for server response after QUIT and before closing connection.
+Subject: [PATCH 2/5] No extra space between ':' and '<' in MAIL FROM and RCPT TO. Wait for server response after QUIT and before closing connection.
 
 git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@579 5301114d-f842-0410-bbdd-996ee0417009
 
@@ -119,7 +119,7 @@
 From 969b56f4bd61ddb8277c04ac2a1e35e029ec058b Mon Sep 17 00:00:00 2001
 From: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
 Date: Fri, 10 Dec 2010 16:24:06 +0000
-Subject: [PATCH 3/4] Fixed unit test after bug fix.
+Subject: [PATCH 3/5] Fixed unit test after bug fix.
 
 git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@580 5301114d-f842-0410-bbdd-996ee0417009
 
@@ -143,7 +143,7 @@
 From 50743da0712b216533acdc09069f1bfc81f988c6 Mon Sep 17 00:00:00 2001
 From: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
 Date: Fri, 10 Dec 2010 16:54:38 +0000
-Subject: [PATCH 4/4] Fixed boundary parsing (thanks to John van der Kamp, Zarafa).
+Subject: [PATCH 4/5] Fixed boundary parsing (thanks to John van der Kamp, Zarafa).
 
 git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@581 5301114d-f842-0410-bbdd-996ee0417009
 
@@ -227,3 +227,55 @@
 -- 
 1.7.1
 
+
+From b6d2b4765c9472ff333cace13c57c6af0e866ee0 Mon Sep 17 00:00:00 2001
+From: vincent-richard <vincent-richard@5301114d-f842-0410-bbdd-996ee0417009>
+Date: Fri, 21 Jan 2011 15:28:06 +0000
+Subject: [PATCH 5/5] Fixed possible infinite loop (thanks to John van der Kamp, Zarafa).
+
+git-svn-id: https://vmime.svn.sourceforge.net/svnroot/vmime/trunk@582 5301114d-f842-0410-bbdd-996ee0417009
+
+diff --git a/src/word.cpp b/src/word.cpp
+index db720dc..1c1c1a6 100644
+--- a/src/word.cpp
++++ b/src/word.cpp
+@@ -386,7 +386,7 @@ void word::generate(utility::outputStream& os, const string::size_type maxLineLe
+ 
+ 		maxRunLength = std::max(maxRunLength, curRunLength);
+ 
+-		if (maxRunLength >= maxLineLength - 3)
++		if (((flags & text::FORCE_NO_ENCODING) == 0) && maxRunLength >= maxLineLength - 3)
+ 		{
+ 			// Generate with encoding forced
+ 			generate(os, maxLineLength, curLinePos, newLinePos, flags | text::FORCE_ENCODING, state);
+diff --git a/tests/parser/textTest.cpp b/tests/parser/textTest.cpp
+index b84f376..746ac94 100644
+--- a/tests/parser/textTest.cpp
++++ b/tests/parser/textTest.cpp
+@@ -52,6 +52,7 @@ VMIME_TEST_SUITE_BEGIN
+ 		VMIME_TEST(testWhitespaceMBox)
+ 
+ 		VMIME_TEST(testFoldingAscii)
++		VMIME_TEST(testForcedNonEncoding)
+ 	VMIME_TEST_LIST_END
+ 
+ 
+@@ -442,5 +443,15 @@ VMIME_TEST_SUITE_BEGIN
+ 			" =?us-ascii?Q?9012345678901234567890123456789?=", w.generate(50));
+ 	}
+ 
++	void testForcedNonEncoding()
++	{
++		// Testing long unbreakable and unencodable header
++		vmime::relay r;
++		r.parse(" from User (Ee9GMqZQ8t7IQwftfAFHd2KyScCYRrFSJ50tKEoXv2bVCG4HcPU80GGWiFabAvG77FekpGgF1h@[127.0.0.1]) by servername.hostname.com\n\t"
++				"with esmtp id 1NGTS9-2C0sqG0; Fri, 4 Dec 2009 09:23:49 +0100");
++
++		VASSERT_EQ("received.long", "from User\r\n (Ee9GMqZQ8t7IQwftfAFHd2KyScCYRrFSJ50tKEoXv2bVCG4HcPU80GGWiFabAvG77FekpGgF1h@[127.0.0.1])\r\n by servername.hostname.com with esmtp id 1NGTS9-2C0sqG0; Fri, 4 Dec 2009\r\n 09:23:49 +0100", r.generate(78));
++	}
++
+ VMIME_TEST_SUITE_END
+ 
+-- 
+1.7.1
+