Commit Graph

67 Commits

Author SHA1 Message Date
Paul Kehrer
451f31b927 Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH
These macros contain this pattern:
1 << ((Int32_value) & 31

This causes the undefined behavior sanitizers in clang and gcc to
complain because the shift, while ultimately stored to an unsigned
variable, is done as a signed value. Adding a cast to unsigned for
the int32 value resolves this issue.
2019-06-08 10:06:40 -04:00
Federico Mena Quintero
ad723d6558 Add a bzip2.doap file
This is a Description Of A Project standard file, with
machine-readable information on the project's metadata.
2019-06-07 18:45:55 -05:00
Federico Mena Quintero
be540ff449 Merge branch 'windows-fixes' into 'master'
Misc fixes

See merge request federicomenaquintero/bzip2!14
2019-06-07 22:53:08 +00:00
Federico Mena Quintero
772dc4d0c3 More markup fixing 2019-06-07 17:48:05 -05:00
Federico Mena Quintero
2bf12d960a Fix README.md markup 2019-06-07 17:46:05 -05:00
Federico Mena Quintero
9d40779524 Turn README into README.md and update it
Move the news summaries to NEWS as well.
2019-06-07 17:41:37 -05:00
Federico Mena Quintero
5368451bcb Merge branch 'alatiera/ci-3' into 'master'
CI: even more minor things

See merge request federicomenaquintero/bzip2!12
2019-06-07 22:10:45 +00:00
Federico Mena Quintero
f47baca49e Add the Contributor Covenant Code of Conduct 1.4 2019-06-07 16:59:58 -05:00
Dylan Baker
6b3d675f78 meson: Support dlls with msvc
I've filed https://github.com/mesonbuild/meson/issues/5462 about the
fact that vs_module_defs cannot accept an empty list (the usual way in
meson to say "nothing" (like NULL, None, etc).

This allows msvc to compile a bz2-1.dll that at least passes the tests
provided.

The .def file doesn't work for mingw due to (I think) differences in the
way msvc and mingw define .def files. I *think*, but I'm not positive,
it has to do with stdcall vs cdecl, but I'm just throwing stuff at the
wall till it sticks.
2019-06-07 12:35:05 -07:00
Marty E. Plummer
9e8d164446 bzip2: fix mingw compilation
https://bugs.gentoo.org/393573

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
2019-06-07 12:35:05 -07:00
Dylan Baker
bd548eebae meson: fix name of library 2019-06-07 12:35:05 -07:00
Jordan Petridis
e914ff3146
CI: use meson test instead of ninja test
meson test is a higher level wrapper around the
generated ninja code. It provides more funtionality,
valgrind/gdb/etc wrappers and its generally more flexible.
2019-06-07 21:51:04 +03:00
Jordan Petridis
c7091f75aa
CI: add a i386 ubuntu build 2019-06-07 21:51:04 +03:00
Jordan Petridis
0c70a1ff2b
CI: drop the extra autotools tests
Testing the autotools setup for every
distribution is expensive
and prolongs the CI build wihtout clear benefit.

Its enough to know that autotools builds in a single distribution.
2019-06-07 21:51:04 +03:00
Federico Mena Quintero
b8144bf807 Merge branch 'patch-2' into 'master'
Update README: changed LICENSE to COPYING

See merge request federicomenaquintero/bzip2!10
2019-06-07 18:30:05 +00:00
Federico Mena Quintero
bc8410f512 Merge branch 'patch-1' into 'master'
Update README: replaced CHANGE file with NEWS file

See merge request federicomenaquintero/bzip2!9
2019-06-07 18:29:40 +00:00
Federico Mena Quintero
f12450af37 Merge branch 'add_mingw_ci' into 'master'
Add mingw CI

See merge request federicomenaquintero/bzip2!13
2019-06-07 18:19:02 +00:00
Albert Astals Cid
0026efd72c Add mingw CI 2019-06-07 19:11:30 +02:00
Federico Mena Quintero
22b6c782f4 Merge branch 'dcbaker/bzip2-mesonify' 2019-06-07 10:40:08 -05:00
Erich Cordoba
fd4c8ac7a8 Merge branch 'alatiera/ci-2' into 'master'
CI: Minor extra tweaks

See merge request federicomenaquintero/bzip2!11
2019-06-06 23:16:16 +00:00
Dylan Baker
0769a76273 .gitlab-ci: Add meson build jobs 2019-06-06 14:18:47 -07:00
Dylan Baker
0a464db0fd move documentation into a docs/ folder 2019-06-06 14:18:47 -07:00
Dylan Baker
b4d062ec93 Move man files into a man/ directory 2019-06-06 14:18:47 -07:00
Dylan Baker
f6f3326c69 Move tests into a tests/ directory
I've updated autotools, meson, and the makefile.msc, though I haven't
verified tat the nmake file works.
2019-06-06 14:18:47 -07:00
Dylan Baker
736902410a add meson build system 2019-06-06 11:10:32 -07:00
Dylan Baker
9780d98afb gitignore: Add autotools generated files 2019-06-06 11:10:32 -07:00
Jordan Petridis
3e3d6f0fe4
CI: use gitlab's 'extends' instead of yaml anchors
'extneds' keyword is more flexible and
better suited for creating job templates
like we do.

Introduced fairly recently.
https://docs.gitlab.com/ee/ci/yaml/#extends
2019-06-06 19:20:05 +03:00
Jordan Petridis
073120fd63
CI: use upstream fedora images
Use the upstream fedora registry instead
of dockerhub.
2019-06-06 19:20:05 +03:00
Dylan Baker
6b00476951 bzip2.c: mingw wants sys/stat.h, not sys\stat.h
MSVC (at least recent versions) doesn't seem to care about / vs \
either.
2019-06-06 08:48:47 -07:00
Federico Mena Quintero
47e52d990e Merge branch 'enable-ci' into 'master'
Add initial CI

See merge request federicomenaquintero/bzip2!2
2019-06-06 13:35:29 +00:00
Jens Korte
42abda6af9 Update README: changed LICENSE to COPYING 2019-06-06 13:10:46 +00:00
Jens Korte
bdfd62e863 Update README replaced CHANGE file with NEWS file 2019-06-06 13:05:40 +00:00
Erich Cordoba
6950019e95 Add initial CI
This initial CI uses debian, ubuntu, fedora and opensuse docker images
to build bzip2.
2019-06-05 23:16:06 -05:00
Wenzong Fan
a7700e70df (#10): fix bunzip2 -qt returns 0 for corrupt archives
"bzip2 -t FILE" returns 2 if FILE exists, but is not a valid bzip2 file.
"bzip2 -qt FILE" returns 0 when this happens, although it does print out
an error message as is does so.

This has been fix by Debian, just port changes from Debian patch file
"20-legacy.patch".

Debian defect:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=279025

Fix item from changelog:
http://archive.debian.net/changelogs/pool/main/b/bzip2/bzip2_1.0.2-7/changelog

Fixes https://gitlab.com/federicomenaquintero/bzip2/issues/10

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
2019-06-05 19:52:28 -05:00
Federico Mena Quintero
f516a7d2fb Update README.autotools 2019-06-05 18:59:32 -05:00
Federico Mena Quintero
5a018ceab4 Remove pre-autotools Makefile-libbz2_so and README.COMPILATION.PROBLEMS 2019-06-05 18:59:32 -05:00
Federico Mena Quintero
ed1be115f9 Removed hardcoded "1.0.6" in manual.xml
Use the entity instead.
2019-06-05 18:55:59 -05:00
Federico Mena Quintero
8eba8137aa Bump version to 1.0.7 2019-06-05 18:55:59 -05:00
Federico Mena Quintero
fdab0f5426 Move the "make test" bits to be part of the standard "make check" 2019-06-05 18:55:59 -05:00
Federico Mena Quintero
cebe990273 bzopen_or_bzdopen() - Open files with O_CLOEXEC with the "e" mode 2019-06-05 18:55:59 -05:00
Federico Mena Quintero
39fddb72e8 Change a magic number for a constant 2019-06-05 18:55:59 -05:00
Albert Astals Cid
74de1e2e6f Make sure nSelectors is not out of range
nSelectors is used in a loop from 0 to nSelectors to access selectorMtf
which is
	UChar    selectorMtf[BZ_MAX_SELECTORS];
so if nSelectors is bigger than BZ_MAX_SELECTORS it'll do an invalid memory
access

Fixes out of bounds access discovered while fuzzying karchive
2019-06-05 18:55:59 -05:00
Federico Mena Quintero
5381b4f2f8 Don't put CFLAG_VISIBILITY in AM_CFLAGS
Otherwise symbols meant to be extern are hidden
2019-06-05 18:55:59 -05:00
Federico Mena Quintero
b0267429ae Have a smarter autogen.sh 2019-06-05 18:55:59 -05:00
Federico Mena Quintero
586a67cc92 Add AUTHORS from the NEWS file 2019-06-05 18:55:59 -05:00
Federico Mena Quintero
2d2322f071 Delete Makefile; it's generated by autotools now 2019-06-05 18:55:59 -05:00
Federico Mena Quintero
8cfd87aed5 Make autogen.sh executable 2019-06-05 18:54:50 -05:00
Federico Mena Quintero
3cf4f6e9cd Rename CHANGES to NEWS 2019-06-05 18:54:50 -05:00
Federico Mena Quintero
1528a55a83 Rename LICENSE to COPYING 2019-06-05 18:54:50 -05:00
Federico Mena Quintero
a81ba197df List patches from openSUSE not included in this git repository 2019-06-05 18:54:50 -05:00