Bug 1246048 - Initialize a variable passed to GetSummaryValid(). It may return without setting it. draft
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Sun, 20 Oct 2019 05:51:05 +0900
changeset 80356 5a3541082f290f3b3498fa77b2d72d0c652d0107
parent 80355 bf06b67a7f40d4f408d8d01bc811f9c08da6274c
child 80357 ecda3836a39cc3eaab78935cfef3d649cbe0dff2
push id9576
push userishikawa@yk.rim.or.jp
push dateSat, 19 Oct 2019 20:51:19 +0000
treeherdertry-comm-central@4e899dfbba0c [default view] [failures only]
bugs1246048
Bug 1246048 - Initialize a variable passed to GetSummaryValid(). It may return without setting it.
mailnews/local/src/nsLocalMailFolder.cpp
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -1844,16 +1844,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::GetN
   nsCOMPtr<nsIMsgLocalMailFolder> localInbox = do_QueryInterface(inbox, &rv);
   if (NS_SUCCEEDED(rv)) {
     bool valid = false;
     nsCOMPtr<nsIMsgDatabase> db;
     // this will kick off a reparse if the db is out of date.
     rv = localInbox->GetDatabaseWithReparse(nullptr, aWindow,
                                             getter_AddRefs(db));
     if (NS_SUCCEEDED(rv)) {
+      valid = false;  // GetSummaryValid may return without setting valid
       db->GetSummaryValid(&valid);
       rv = valid
                ? localMailServer->GetNewMail(aWindow, aListener, inbox, nullptr)
                : localInbox->SetCheckForNewMessagesAfterParsing(true);
     }
   }
   return rv;
 }