Skip to content

Commit

Permalink
Apply "exactly fill up the buffer" fix from toybox's bunzip.c.
Browse files Browse the repository at this point in the history
Quoting the original commit message:

> It's not a problem to exactly fill up the buffer with a run if the
> next symbol is the terminating symbol. Fixes
> https://jira.cyanogenmod.org/browse/CYAN-1896

See: http://landley.net/hg/toybox/rev/7b6fbc0475d8
  • Loading branch information
cscott committed Jul 27, 2015
1 parent 3f42154 commit f744c80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Bzip2.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ Bunzip.prototype._get_next_block = function() {
literal used is the one at the head of the mtfSymbol array.) */
if (runPos){
runPos = 0;
if (dbufCount + t >= this.dbufSize) { _throw(Err.DATA_ERROR); }
if (dbufCount + t > this.dbufSize) { _throw(Err.DATA_ERROR); }
uc = symToByte[mtfSymbol[0]];
byteCount[uc] += t;
while (t--)
Expand Down

0 comments on commit f744c80

Please sign in to comment.