From 3c18693a60b06172de11d8f15c1a045598ec3e65 Mon Sep 17 00:00:00 2001 From: Josh Wolfe Date: Tue, 13 Dec 2016 16:54:09 -0700 Subject: [PATCH] fix harmless off-by-1 error in eager buffering strategy for first read --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 507522d..2f3c9ba 100644 --- a/index.js +++ b/index.js @@ -94,7 +94,7 @@ function fromRandomAccessReader(reader, totalSize, options, callback) { // as a consequence of this design decision, it's possible to have ambiguous zip file metadata if a coherent eocdr was in the comment. // we search backwards for a eocdr signature, and hope that whoever made the zip file was smart enough to forbid the eocdr signature in the comment. var eocdrWithoutCommentSize = 22; - var maxCommentSize = 0x10000; // 2-byte size + var maxCommentSize = 0xffff; // 2-byte size var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize); var buffer = new Buffer(bufferSize); var bufferReadStart = totalSize - buffer.length;