logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0025-Fix-bug-in-UZbunzip2-that-incorrectly-updated-G.incn.patch (968B)


  1. From 705923de022bad2ce0142ccbab68aa57ebe36db1 Mon Sep 17 00:00:00 2001
  2. From: Mark Adler <madler@alumni.caltech.edu>
  3. Date: Mon, 28 Apr 2025 12:57:34 -0700
  4. Subject: [PATCH] Fix bug in UZbunzip2() that incorrectly updated G.incnt
  5. Fix bug in UZbunzip2() that incorrectly updated G.incnt.
  6. The update assumed a full buffer, which is not always full. This
  7. could result in a false overlapped element detection when a small
  8. bzip2-compressed file was unzipped. This commit remedies that.
  9. ---
  10. extract.c | 2 +-
  11. 1 file changed, 1 insertion(+), 1 deletion(-)
  12. diff --git a/extract.c b/extract.c
  13. index ad5daac..6712ed0 100644
  14. --- a/extract.c
  15. +++ b/extract.c
  16. @@ -3052,7 +3052,7 @@ __GDEF
  17. #endif
  18. G.inptr = (uch *)bstrm.next_in;
  19. - G.incnt = (G.inbuf + INBUFSIZ) - G.inptr; /* reset for other routines */
  20. + G.incnt -= G.inptr - G.inbuf; /* reset for other routines */
  21. uzbunzip_cleanup_exit:
  22. err = BZ2_bzDecompressEnd(&bstrm);
  23. --
  24. 2.45.2