Bug 1609607 - Fix message ID calculation. r=mkmelin, r=kaie
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Mon, 27 Jan 2020 12:52:59 +0100
changeset 38020 62a84e316dab6346317e77a75d50e79239a17936
parent 38019 3420cbdab2ab5f2627d5a8535790bf65222f7928
child 38021 a4e036ddf0334578d6330d8cd6e31e93a46de8fa
push id398
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:10:28 +0000
reviewersmkmelin, kaie
bugs1609607
Bug 1609607 - Fix message ID calculation. r=mkmelin, r=kaie
mailnews/local/src/nsParseMailbox.cpp
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -1364,17 +1364,17 @@ nsresult nsParseMailMessageState::Finali
           const char *md5_b64 = "dummy.message.id";
           nsresult rv;
           nsCOMPtr<nsICryptoHash> hasher =
               do_CreateInstance("@mozilla.org/security/hash;1", &rv);
           if (NS_SUCCEEDED(rv)) {
             if (NS_SUCCEEDED(hasher->Init(nsICryptoHash::MD5)) &&
                 NS_SUCCEEDED(
                     hasher->Update((const uint8_t *)m_headers.GetBuffer(),
-                                   m_headers.GetSize())) &&
+                                   m_headers.GetBufferPos())) &&
                 NS_SUCCEEDED(hasher->Finish(true, hash)))
               md5_b64 = hash.get();
           }
           PR_snprintf(md5_data, sizeof(md5_data), "<md5:%s>", md5_b64);
           md5_header.value = md5_data;
           md5_header.length = strlen(md5_data);
           id = &md5_header;
         }