logo

oasis

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

0026-Fix-bug-in-UZinflate-that-incorrectly-updated-G.incn.patch (1033B)


  1. From a07b1c0bb82b6dc0f8f224894e49eb9b44a076db 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 UZinflate() that incorrectly updated G.incnt.
  5. Fix bug in UZinflate() 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. deflate-compressed file was unzipped using an old zlib. This
  9. commit remedies that.
  10. ---
  11. inflate.c | 2 +-
  12. 1 file changed, 1 insertion(+), 1 deletion(-)
  13. diff --git a/inflate.c b/inflate.c
  14. index f2f6864..2c37999 100644
  15. --- a/inflate.c
  16. +++ b/inflate.c
  17. @@ -700,7 +700,7 @@ int UZinflate(__G__ is_defl64)
  18. G.dstrm.total_out));
  19. G.inptr = (uch *)G.dstrm.next_in;
  20. - G.incnt = (G.inbuf + INBUFSIZ) - G.inptr; /* reset for other routines */
  21. + G.incnt -= G.inptr - G.inbuf; /* reset for other routines */
  22. uzinflate_cleanup_exit:
  23. err = inflateReset(&G.dstrm);
  24. --
  25. 2.45.2