diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-11-29 11:51:15 +0000 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-11-29 21:20:36 +0100 |
commit | 86207ca7eed9677f8ffe2d0bcfb7cf8c68b703d4 (patch) | |
tree | a26c402130099d76905de23af28fe319ef2bc356 /oox | |
parent | 3278c8f9bb040cddd15d9e7eb4991d0447cbc964 (diff) |
ofz: avoid invalid short hashValues
Change-Id: Ib7cd63351f4e5ed053e55fe9c5875ad92c81d762
Reviewed-on: https://gerrit.libreoffice.org/45492
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/crypto/AgileEngine.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
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); |