logo

oasis

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

0015-fix-infinite-loop-when-extracting-empty-bzip2-data.patch (774B)


  1. From e646271050da793fe50fe829b465c4e692fb7d53 Mon Sep 17 00:00:00 2001
  2. From: Kamil Dudka <kdudka@redhat.com>
  3. Date: Mon, 14 Sep 2015 18:24:56 +0200
  4. Subject: [PATCH] fix infinite loop when extracting empty bzip2 data
  5. ---
  6. extract.c | 6 ++++++
  7. 1 file changed, 6 insertions(+)
  8. diff --git a/extract.c b/extract.c
  9. index f951b9f..188f1cf 100644
  10. --- a/extract.c
  11. +++ b/extract.c
  12. @@ -2729,6 +2729,12 @@ __GDEF
  13. int repeated_buf_err;
  14. bz_stream bstrm;
  15. + if (G.incnt <= 0 && G.csize <= 0L) {
  16. + /* avoid an infinite loop */
  17. + Trace((stderr, "UZbunzip2() got empty input\n"));
  18. + return 2;
  19. + }
  20. +
  21. #if (defined(DLL) && !defined(NO_SLIDE_REDIR))
  22. if (G.redirect_slide)
  23. wsize = G.redirect_size, redirSlide = G.redirect_buffer;
  24. --
  25. 2.20.1