email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp
branchCompilerCompatibility
changeset 20 43cbef41dd6d
parent 9 1d7827e39b52
child 40 224522e33db9
child 42 1367103c24e2
child 47 5b14749788d7
--- a/email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp	Sun Mar 28 16:36:08 2010 +0100
+++ b/email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp	Mon Mar 29 12:25:56 2010 +0100
@@ -254,11 +254,16 @@
 			 // Folding headers, RFC 2822, section 2.2.3
 			{
 			// make sure we're not about to exceed the buffer
-			if((iOutputLine->Length() + iInputLine.Length()) > iOutputLine->Des().MaxLength())
-				iOutputLine = iOutputLine->ReAllocL(iOutputLine->Length() + iInputLine.Length());
-
-			// now copy the remaining data into the buffer
-			iOutputLine->Des().Append(iInputLine);
+			//Restricting the field size of the header to 5000, to avoid -4 error
+			//and which at times ends up in DOS condition [denial of service- user wouldn't be able to download any further mails]. 
+			if (iOutputLine->Length()<5000)
+				{
+				if((iOutputLine->Length() + iInputLine.Length()) > iOutputLine->Des().MaxLength())
+					iOutputLine = iOutputLine->ReAllocL(iOutputLine->Length() + iInputLine.Length());
+
+				// now copy the remaining data into the buffer
+				iOutputLine->Des().Append(iInputLine);
+			    }
 			}
 		}
 	else