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)

View File

@ -29,6 +29,7 @@
!freeculture.pdf
!pdfkit_compressed.pdf
!TAMReview.pdf
!bug900822.pdf
!issue918.pdf
!issue1905.pdf
!issue2833.pdf

BIN
test/pdfs/bug900822.pdf Normal file

Binary file not shown.

View File

@ -1439,6 +1439,12 @@
"rounds": 1,
"type": "eq"
},
{ "id": "bug900822",
"file": "pdfs/bug900822.pdf",
"md5": "70e2a3c5922574eeda169c955cf9d084",
"rounds": 1,
"type": "load"
},
{ "id": "issue2853",
"file": "pdfs/issue2853.pdf",
"md5": "9f0ad95ef0b243ee8813c4eca0f7a042",