From 0cfc19e6747598e32a607019c92cb208d11f8fa5 Mon Sep 17 00:00:00 2001 From: "cavin%netscape.com" Date: Wed, 1 Aug 2001 20:19:29 +0000 Subject: [PATCH] Fix for bug 92938. Allocate one more byte when creating a new string in EnsureLineBreaks(). r=ducarroz,sr=bienvenu. --- mailnews/compose/src/nsMsgSend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailnews/compose/src/nsMsgSend.cpp b/mailnews/compose/src/nsMsgSend.cpp index 38a4de74cd95..b9b60227b6dd 100644 --- a/mailnews/compose/src/nsMsgSend.cpp +++ b/mailnews/compose/src/nsMsgSend.cpp @@ -1442,7 +1442,7 @@ nsMsgComposeAndSend::EnsureLineBreaks(const char *body, PRUint32 bodyLen) if (!newBody) { // in the worse case, the body will be solid, no linebreaks. // that will require us to insert a line break every LINE_BREAK_MAX bytes - PRUint32 worstCaseLen = bodyLen+((bodyLen/LINE_BREAK_MAX)*NS_LINEBREAK_LEN); + PRUint32 worstCaseLen = bodyLen+((bodyLen/LINE_BREAK_MAX)*NS_LINEBREAK_LEN)+1; newBody = (char *) PR_Malloc(worstCaseLen); if (!newBody) return NS_ERROR_OUT_OF_MEMORY; newBodyPos = newBody;