Commit | Line | Data |
---|---|---|
51de92a0 MW |
1 | Copied from Debian. |
2 | ||
3 | From: Kamil Dudka <kdudka@redhat.com> | |
4 | Date: Mon, 14 Sep 2015 18:24:56 +0200 | |
5 | Subject: fix infinite loop when extracting empty bzip2 data | |
6 | Bug-Debian: https://bugs.debian.org/802160 | |
7 | Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1260944 | |
8 | Origin: other, https://bugzilla.redhat.com/attachment.cgi?id=1073339 | |
9 | ||
10 | --- | |
11 | extract.c | 6 ++++++ | |
12 | 1 file changed, 6 insertions(+) | |
13 | ||
14 | --- a/extract.c | |
15 | +++ b/extract.c | |
16 | @@ -2728,6 +2728,12 @@ | |
17 | int repeated_buf_err; | |
18 | bz_stream bstrm; | |
19 | ||
20 | + if (G.incnt <= 0 && G.csize <= 0L) { | |
21 | + /* avoid an infinite loop */ | |
22 | + Trace((stderr, "UZbunzip2() got empty input\n")); | |
23 | + return 2; | |
24 | + } | |
25 | + | |
26 | #if (defined(DLL) && !defined(NO_SLIDE_REDIR)) | |
27 | if (G.redirect_slide) | |
28 | wsize = G.redirect_size, redirSlide = G.redirect_buffer; |