Skip to content

Commit

Permalink
fix harmless off-by-1 error in eager buffering strategy for first read
Browse files Browse the repository at this point in the history
  • Loading branch information
thejoshwolfe committed Dec 13, 2016
1 parent 1f5cb3d commit 3c18693
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3c18693

Please sign in to comment.