From dd58f05fc83ee65db3586cd1f59e3e87bdb223d8 Mon Sep 17 00:00:00 2001 From: "ducarroz%netscape.com" Date: Fri, 2 Feb 2001 03:43:52 +0000 Subject: [PATCH] Fix for bug 37967. We need to remove null lines caused by an earlier database corruption. R=naving, SR=mscott git-svn-id: svn://10.0.0.236/trunk@86046 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/mime/src/mimebuf.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mozilla/mailnews/mime/src/mimebuf.cpp b/mozilla/mailnews/mime/src/mimebuf.cpp index 16754804db7..356b865ccdc 100644 --- a/mozilla/mailnews/mime/src/mimebuf.cpp +++ b/mozilla/mailnews/mime/src/mimebuf.cpp @@ -119,6 +119,17 @@ convert_and_send_buffer(char* buf, int length, PRBool convert_newlines_p, */ char* newline; +#if (MSG_LINEBREAK_LEN == 2) + /*** + * This is a patch to support a mail DB corruption cause by earlier version that lead to a crash. + * What happened is that the line terminator is CR+NULL+LF. Therefore, we first process a line + * terminated by CR then a second line that contains only NULL+LF. We need to ignore this second + * line. See bug http://bugzilla.mozilla.org/show_bug.cgi?id=61412 for more information. + ***/ + if (length == 2 && buf[0] == 0x00 && buf[1] == LF) + return 0; +#endif + PR_ASSERT(buf && length > 0); if (!buf || length <= 0) return -1; newline = buf + length;