[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - oox/source

Caolán McNamara caolanm at redhat.com
Wed Nov 29 20:21:04 UTC 2017


 oox/source/crypto/AgileEngine.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 86207ca7eed9677f8ffe2d0bcfb7cf8c68b703d4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 29 11:51:15 2017 +0000

    ofz: avoid invalid short hashValues
    
    Change-Id: Ib7cd63351f4e5ed053e55fe9c5875ad92c81d762
    Reviewed-on: https://gerrit.libreoffice.org/45492
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/oox/source/crypto/AgileEngine.cxx b/oox/source/crypto/AgileEngine.cxx
index 72539509c965..b12e8d344c6b 100644
--- a/oox/source/crypto/AgileEngine.cxx
+++ b/oox/source/crypto/AgileEngine.cxx
@@ -130,7 +130,7 @@ bool AgileEngine::generateEncryptionKey(const OUString& rPassword)
     std::vector<sal_uInt8> hash(mInfo.hashSize, 0);
     hashCalc(hash, hashInput, mInfo.hashAlgorithm);
 
-    if (std::equal (hash.begin(), hash.end(), hashValue.begin()) )
+    if (hash.size() <= hashValue.size() && std::equal(hash.begin(), hash.end(), hashValue.begin()))
     {
         std::vector<sal_uInt8>& encryptedKeyValue = mInfo.encryptedKeyValue;
         calculateBlock(constBlock3, hashFinal, encryptedKeyValue, mKey);


More information about the Libreoffice-commits mailing list