Bug 1444389 - Fix crash in nsImapProtocol::HandleMessageDownLoadLine(). r+a=jorgk
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Mon, 01 Oct 2018 15:06:55 +0300
changeset 33049 90c267d6d48f
parent 33048 872d9710ea55
child 33050 788a85e7fd34
push id386
push userclokep@gmail.com
push dateTue, 23 Oct 2018 00:48:12 +0000
bugs1444389
Bug 1444389 - Fix crash in nsImapProtocol::HandleMessageDownLoadLine(). r+a=jorgk
mailnews/imap/src/nsImapProtocol.cpp
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -3840,16 +3840,17 @@ nsImapProtocol::PostLineDownLoadEvent(co
 // * A line may be passed by parts, e.g., "part1 part2\r\n" may be passed as
 //     HandleMessageDownLoadLine("part 1 ", 1);
 //     HandleMessageDownLoadLine("part 2\r\n", 0);
 //   However, it is assumed that a CRLF or a CRCRLF is never split (i.e., this is
 //   ensured *before* invoking this method).
 void nsImapProtocol::HandleMessageDownLoadLine(const char *line, bool isPartialLine,
                                                char *lineCopy)
 {
+  NS_ENSURE_TRUE_VOID(line);
   NS_ASSERTION(lineCopy == nullptr || !PL_strcmp(line, lineCopy),
                "line and lineCopy must contain the same string");
   const char *messageLine = line;
   uint32_t lineLength = strlen(messageLine);
   const char *cEndOfLine = messageLine + lineLength;
   char *localMessageLine = nullptr;
 
   // If we obtain a partial line (due to fetching by chunks), we do not