email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp
branchRCL_3
changeset 11 9a08a7b164a5
parent 0 72b543305e3a
child 40 224522e33db9
child 42 1367103c24e2
child 47 5b14749788d7
--- a/email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp	Tue Feb 02 00:08:43 2010 +0200
+++ b/email/pop3andsmtpmtm/servermtmutils/src/imcvrecv.cpp	Fri Feb 19 22:47:38 2010 +0200
@@ -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