Skip to content

Commit 0530199

Browse files
authored
Merge pull request #25 from corona10/bzip2-1.0.8
bzip2: Upgrade to bzip2 1.0.8
2 parents 4de0229 + bb3f60e commit 0530199

36 files changed

+368
-333
lines changed

CHANGES

+31-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
This file is part of bzip2/libbzip2, a program and library for
33
lossless, block-sorting data compression.
44

5-
bzip2/libbzip2 version 1.0.6 of 6 September 2010
6-
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
5+
bzip2/libbzip2 version 1.0.8 of 13 July 2019
6+
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
77

88
Please read the WARNING, DISCLAIMER and PATENTS sections in the
99
README file.
@@ -325,3 +325,32 @@ Security fix only. Fixes CERT-FI 20469 as it applies to bzip2.
325325
Izdebski.
326326

327327
* Make the documentation build on Ubuntu 10.04
328+
329+
1.0.7 (27 Jun 19)
330+
~~~~~~~~~~~~~~~~~
331+
332+
* Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH
333+
334+
* bzip2: Fix return value when combining --test,-t and -q.
335+
336+
* bzip2recover: Fix buffer overflow for large argv[0]
337+
338+
* bzip2recover: Fix use after free issue with outFile (CVE-2016-3189)
339+
340+
* Make sure nSelectors is not out of range (CVE-2019-12900)
341+
342+
1.0.8 (13 Jul 19)
343+
~~~~~~~~~~~~~~~~~
344+
345+
* Accept as many selectors as the file format allows.
346+
This relaxes the fix for CVE-2019-12900 from 1.0.7
347+
so that bzip2 allows decompression of bz2 files that
348+
use (too) many selectors again.
349+
350+
* Fix handling of large (> 4GB) files on Windows.
351+
352+
* Cleanup of bzdiff and bzgrep scripts so they don't use
353+
any bash extensions and handle multiple archives correctly.
354+
355+
* There is now a bz2-files testsuite at
356+
https://sourceware.org/git/bzip2-tests.git

LICENSE

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--------------------------------------------------------------------------
33

44
This program, "bzip2", the associated library "libbzip2", and all
5-
documentation, are copyright (C) 1996-2010 Julian R Seward. All
5+
documentation, are copyright (C) 1996-2019 Julian R Seward. All
66
rights reserved.
77

88
Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
3636
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3737
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3838

39-
Julian Seward, jseward@bzip.org
40-
bzip2/libbzip2 version 1.0.6 of 6 September 2010
39+
Julian Seward, jseward@acm.org
40+
bzip2/libbzip2 version 1.0.8 of 13 July 2019
4141

4242
--------------------------------------------------------------------------

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# This file is part of bzip2/libbzip2, a program and library for
33
# lossless, block-sorting data compression.
44
#
5-
# bzip2/libbzip2 version 1.0.6 of 6 September 2010
6-
# Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
5+
# bzip2/libbzip2 version 1.0.8 of 13 July 2019
6+
# Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
77
#
88
# Please read the WARNING, DISCLAIMER and PATENTS sections in the
99
# README file.
@@ -137,7 +137,7 @@ bzip2recover.o: bzip2recover.c
137137
distclean: clean
138138
rm -f manual.ps manual.html manual.pdf
139139

140-
DISTNAME=bzip2-1.0.6
140+
DISTNAME=bzip2-1.0.8
141141
dist: check manual
142142
rm -f $(DISTNAME)
143143
ln -s -f . $(DISTNAME)

Makefile-libbz2_so

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# This Makefile builds a shared version of the library,
3-
# libbz2.so.1.0.6, with soname libbz2.so.1.0,
3+
# libbz2.so.1.0.8, with soname libbz2.so.1.0,
44
# at least on x86-Linux (RedHat 7.2),
55
# with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98).
66
# Please see the README file for some important info
@@ -10,8 +10,8 @@
1010
# This file is part of bzip2/libbzip2, a program and library for
1111
# lossless, block-sorting data compression.
1212
#
13-
# bzip2/libbzip2 version 1.0.6 of 6 September 2010
14-
# Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
13+
# bzip2/libbzip2 version 1.0.8 of 13 July 2019
14+
# Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
1515
#
1616
# Please read the WARNING, DISCLAIMER and PATENTS sections in the
1717
# README file.
@@ -35,13 +35,13 @@ OBJS= blocksort.o \
3535
bzlib.o
3636

3737
all: $(OBJS)
38-
$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
39-
$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
38+
$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS)
39+
$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8
4040
rm -f libbz2.so.1.0
41-
ln -s libbz2.so.1.0.6 libbz2.so.1.0
41+
ln -s libbz2.so.1.0.8 libbz2.so.1.0
4242

4343
clean:
44-
rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
44+
rm -f $(OBJS) bzip2.o libbz2.so.1.0.8 libbz2.so.1.0 bzip2-shared
4545

4646
blocksort.o: blocksort.c
4747
$(CC) $(CFLAGS) -c blocksort.c

README

+10-29
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This version is fully compatible with the previous public releases.
66
This file is part of bzip2/libbzip2, a program and library for
77
lossless, block-sorting data compression.
88

9-
bzip2/libbzip2 version 1.0.6 of 6 September 2010
10-
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
9+
bzip2/libbzip2 version 1.0.8 of 13 July 2019
10+
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
1111

1212
Please read the WARNING, DISCLAIMER and PATENTS sections in this file.
1313

@@ -73,7 +73,7 @@ HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc.
7373

7474
It's difficult for me to support compilation on all these platforms.
7575
My approach is to collect binaries for these platforms, and put them
76-
on the master web site (http://www.bzip.org). Look there. However
76+
on the master web site (https://sourceware.org/bzip2/). Look there. However
7777
(FWIW), bzip2-1.0.X is very standard ANSI C and should compile
7878
unmodified with MS Visual C. If you have difficulties building, you
7979
might want to read README.COMPILATION.PROBLEMS.
@@ -161,43 +161,22 @@ WHAT'S NEW IN 0.9.5 ?
161161
* Many small improvements in file and flag handling.
162162
* A Y2K statement.
163163

164-
WHAT'S NEW IN 1.0.0 ?
164+
WHAT'S NEW IN 1.0.x ?
165165

166166
See the CHANGES file.
167167

168-
WHAT'S NEW IN 1.0.2 ?
169-
170-
See the CHANGES file.
171-
172-
WHAT'S NEW IN 1.0.3 ?
173-
174-
See the CHANGES file.
175-
176-
WHAT'S NEW IN 1.0.4 ?
177-
178-
See the CHANGES file.
179-
180-
WHAT'S NEW IN 1.0.5 ?
181-
182-
See the CHANGES file.
183-
184-
WHAT'S NEW IN 1.0.6 ?
185-
186-
See the CHANGES file.
187-
188-
189-
I hope you find bzip2 useful. Feel free to contact me at
190-
168+
I hope you find bzip2 useful. Feel free to contact the developers at
169+
191170
if you have any suggestions or queries. Many people mailed me with
192171
comments, suggestions and patches after the releases of bzip-0.15,
193172
bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
194173
1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this
195174
feedback. I thank you for your comments.
196175

197-
bzip2's "home" is http://www.bzip.org/
176+
bzip2's "home" is https://sourceware.org/bzip2/
198177

199178
Julian Seward
200-
jseward@bzip.org
179+
jseward@acm.org
201180
Cambridge, UK.
202181

203182
18 July 1996 (version 0.15)
@@ -213,3 +192,5 @@ Cambridge, UK.
213192
20 December 2006 (bzip2, version 1.0.4)
214193
10 December 2007 (bzip2, version 1.0.5)
215194
6 Sept 2010 (bzip2, version 1.0.6)
195+
27 June 2019 (bzip2, version 1.0.7)
196+
13 July 2019 (bzip2, version 1.0.8)

README.COMPILATION.PROBLEMS

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
This file is part of bzip2/libbzip2, a program and library for
33
lossless, block-sorting data compression.
44

5-
bzip2/libbzip2 version 1.0.6 of 6 September 2010
6-
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
5+
bzip2/libbzip2 version 1.0.8 of 13 July 2019
6+
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
77

88
Please read the WARNING, DISCLAIMER and PATENTS sections in the
99
README file.
@@ -12,7 +12,7 @@ This program is released under the terms of the license contained
1212
in the file LICENSE.
1313
------------------------------------------------------------------
1414

15-
bzip2-1.0.6 should compile without problems on the vast majority of
15+
bzip2 should compile without problems on the vast majority of
1616
platforms. Using the supplied Makefile, I've built and tested it
1717
myself for x86-linux and amd64-linux. With makefile.msc, Visual C++
1818
6.0 and nmake, you can build a native Win32 version too. Large file

README.XML.STUFF

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
This file is part of bzip2/libbzip2, a program and library for
33
lossless, block-sorting data compression.
44

5-
bzip2/libbzip2 version 1.0.6 of 6 September 2010
6-
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
5+
bzip2/libbzip2 version 1.0.8 of 13 July 2019
6+
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
77

88
Please read the WARNING, DISCLAIMER and PATENTS sections in the
99
README file.

blocksort.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
This file is part of bzip2/libbzip2, a program and library for
99
lossless, block-sorting data compression.
1010
11-
bzip2/libbzip2 version 1.0.6 of 6 September 2010
12-
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
11+
bzip2/libbzip2 version 1.0.8 of 13 July 2019
12+
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
1313
1414
Please read the WARNING, DISCLAIMER and PATENTS sections in the
1515
README file.
@@ -202,9 +202,9 @@ void fallbackQSort3 ( UInt32* fmap,
202202
bhtab [ 0 .. 2+(nblock/32) ] destroyed
203203
*/
204204

205-
#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31))
206-
#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31))
207-
#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31)))
205+
#define SET_BH(zz) bhtab[(zz) >> 5] |= ((UInt32)1 << ((zz) & 31))
206+
#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~((UInt32)1 << ((zz) & 31))
207+
#define ISSET_BH(zz) (bhtab[(zz) >> 5] & ((UInt32)1 << ((zz) & 31)))
208208
#define WORD_BH(zz) bhtab[(zz) >> 5]
209209
#define UNALIGNED_BH(zz) ((zz) & 0x01f)
210210

bz-html.xsl

+7-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
88
<xsl:import href="bz-common.xsl"/>
99

10-
<!-- use 8859-1 encoding -->
11-
<xsl:output method="html" encoding="ISO-8859-1" indent="yes"/>
10+
<!-- use UTF-8 encoding -->
11+
<xsl:output method="html" encoding="UTF-8" indent="yes"/>
1212

13-
<!-- we include the css directly when generating one large file -->
14-
<xsl:template name="user.head.content">
13+
<!-- we include the css as link and directly when generating one large file -->
14+
<xsl:template name="user.head.content">
15+
<xsl:text disable-output-escaping="yes">
16+
<![CDATA[<]]>link rel="stylesheet" type="text/css" href="bzip.css" />
17+
</xsl:text>
1518
<style type="text/css" media="screen">
1619
<xsl:text>&bz-css;</xsl:text>
1720
</style>

bzdiff

100644100755
+8-8
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ if test -z "$FILES"; then
3737
echo "Usage: $prog [${comp}_options] file [file]"
3838
exit 1
3939
fi
40-
tmp=`mktemp ${TMPDIR:-/tmp}/bzdiff.XXXXXXXXXX` || {
41-
echo 'cannot create a temporary file' >&2
42-
exit 1
43-
}
4440
set $FILES
4541
if test $# -eq 1; then
4642
FILE=`echo "$1" | sed 's/.bz2$//'`
@@ -53,10 +49,14 @@ elif test $# -eq 2; then
5349
case "$2" in
5450
*.bz2)
5551
F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
56-
bzip2 -cdfq "$2" > $tmp
57-
bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp
52+
tmp=`mktemp "${TMPDIR:-/tmp}"/bzdiff.XXXXXXXXXX` || {
53+
echo 'cannot create a temporary file' >&2
54+
exit 1
55+
}
56+
bzip2 -cdfq "$2" > "$tmp"
57+
bzip2 -cdfq "$1" | $comp $OPTIONS - "$tmp"
5858
STAT="$?"
59-
/bin/rm -f $tmp;;
59+
/bin/rm -f "$tmp";;
6060

6161
*) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
6262
STAT="$?";;
@@ -69,8 +69,8 @@ elif test $# -eq 2; then
6969
STAT="$?";;
7070
esac;;
7171
esac
72-
exit "$STAT"
7372
else
7473
echo "Usage: $prog [${comp}_options] file [file]"
7574
exit 1
7675
fi
76+
exit "$STAT"

bzgrep

100644100755
+15-5
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,22 @@ for i do
6363
bzip2 -cdfq "$i" | $grep $opt "$pat"
6464
r=$?
6565
else
66-
j=${i//\\/\\\\}
67-
j=${j//|/\\|}
68-
j=${j//&/\\&}
66+
j=$(echo "$i" | sed 's/\\/&&/g;s/|/\\&/g;s/&/\\&/g')
6967
j=`printf "%s" "$j" | tr '\n' ' '`
70-
bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
71-
r=$?
68+
# A trick adapted from
69+
# https://groups.google.com/forum/#!original/comp.unix.shell/x1345iu10eg/Nn1n-1r1uU0J
70+
# that has the same effect as the following bash code:
71+
# bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
72+
# r=${PIPESTATUS[1]}
73+
exec 3>&1
74+
eval `
75+
exec 4>&1 >&3 3>&-
76+
{
77+
bzip2 -cdfq "$i" 4>&-
78+
} | {
79+
$grep $opt "$pat" 4>&-; echo "r=$?;" >&4
80+
} | sed "s|^|${j}:|"
81+
`
7282
fi
7383
test "$r" -ne 0 && res="$r"
7484
done

bzip.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dd {
2525
/* -- ruler -- */
2626
div.hr_blue {
2727
height: 3px;
28-
background:#ffffff url("/images/hr_blue.png") repeat-x; }
28+
background:#ffffff url("../images/hr_blue.png") repeat-x; }
2929
div.hr_blue hr { display:none; }
3030

3131
/* release styles */
@@ -38,7 +38,7 @@ div.hr_blue hr { display:none; }
3838
ul {
3939
margin: 0px 4px 16px 16px;
4040
padding: 0px;
41-
list-style: url("/images/li-blue.png");
41+
list-style: url("../images/li-blue.png");
4242
}
4343
ul li {
4444
margin-bottom: 10px;

bzip2.1

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PU
22
.TH bzip2 1
33
.SH NAME
4-
bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6
4+
bzip2, bunzip2 \- a block-sorting file compressor, v1.0.8
55
.br
66
bzcat \- decompresses files to stdout
77
.br
@@ -405,7 +405,7 @@ I/O error messages are not as helpful as they could be.
405405
tries hard to detect I/O errors and exit cleanly, but the details of
406406
what the problem is sometimes seem rather misleading.
407407

408-
This manual page pertains to version 1.0.6 of
408+
This manual page pertains to version 1.0.8 of
409409
.I bzip2.
410410
Compressed data created by this version is entirely forwards and
411411
backwards compatible with the previous public releases, versions
@@ -427,9 +427,9 @@ with MaybeUInt64 set to be an unsigned 64-bit integer.
427427

428428

429429
.SH AUTHOR
430-
Julian Seward, jsewardbzip.org.
430+
Julian Seward, jseward@acm.org.
431431

432-
http://www.bzip.org
432+
https://sourceware.org/bzip2/
433433

434434
The ideas embodied in
435435
.I bzip2

0 commit comments

Comments
 (0)