Skip to content

Commit

Permalink
Fix bug in UZbunzip2() that incorrectly updated G.incnt.
Browse files Browse the repository at this point in the history
The update assumed a full buffer, which is not always full. This
could result in a false overlapped element detection when a small
bzip2-compressed file was unzipped. This commit remedies that.
  • Loading branch information
madler committed Feb 10, 2020
1 parent 13f0260 commit 5e2efcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extract.c
Expand Up @@ -3010,7 +3010,7 @@ __GDEF
#endif

G.inptr = (uch *)bstrm.next_in;
G.incnt = (G.inbuf + INBUFSIZ) - G.inptr; /* reset for other routines */
G.incnt -= G.inptr - G.inbuf; /* reset for other routines */

uzbunzip_cleanup_exit:
err = BZ2_bzDecompressEnd(&bstrm);
Expand Down

0 comments on commit 5e2efcd

Please sign in to comment.