зеркало из https://github.com/mozilla/pjs.git
Fix for bug 92938. Allocate one more byte when creating a new string in EnsureLineBreaks(). r=ducarroz,sr=bienvenu.
This commit is contained in:
Родитель
576366cdbf
Коммит
7f99f07f82
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче