1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Allocates bigger hashData buffer

This commit is contained in:
Yury Delendik 2013-11-18 07:48:06 -06:00
parent c320a0c2a5
commit 2b63cd7e62
4 changed files with 9 additions and 1 deletions

View file

@ -449,7 +449,8 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
function prepareKeyData(fileId, password, ownerPassword, userPassword,
flags, revision, keyLength, encryptMetadata) {
var hashData = new Uint8Array(100), i = 0, j, n;
var hashDataSize = 40 + ownerPassword.length + fileId.length;
var hashData = new Uint8Array(hashDataSize), i = 0, j, n;
if (password) {
n = Math.min(32, password.length);
for (; i < n; ++i)