Bug 1609607 - Fix message ID calculation. r+a=mkmelin, r=kaie
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Mon, 27 Jan 2020 12:52:59 +0100
changeset 37896 361783282f8a84f6aec382d366886966e64710b1
parent 37895 432f80bf179a1c0d7d5996ed879397cfa263918d
child 37897 f61f39e9e87e830b476ce6d696ccef37eeaf3c50
push id397
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:16:13 +0000
reviewerskaie
bugs1609607
Bug 1609607 - Fix message ID calculation. r+a=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;
         }