]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
22 months agoValidate entry_bytes_remaining in pax_attribute 1753/head
Ben Wagner [Tue, 19 Jul 2022 17:02:40 +0000 (13:02 -0400)] 
Validate entry_bytes_remaining in pax_attribute

The `size` attribute may contain a negative or too large value. Check
the range of the `entry_bytes_remaining` in `pax_attribute` the same way
as `header_common`. The test which is added passes both with and without
this change in a normal debug build. It is necessary to run with
`-fsanitize=undefined` to see that the undefined behavior is avoided.

Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=48467

23 months agoMerge pull request #1688 from hemnstill/zstd_windows
Martin Matuška [Wed, 29 Jun 2022 08:41:30 +0000 (10:41 +0200)] 
Merge pull request #1688 from hemnstill/zstd_windows

include zstd 1.5.2 on windows ci builds

23 months agoMerge pull request #1744 from seanm/snprintf
Martin Matuška [Wed, 29 Jun 2022 08:41:03 +0000 (10:41 +0200)] 
Merge pull request #1744 from seanm/snprintf

Fixed issue #1743: Changed sprintf to safer snprintf

23 months agoFixed issue #1743: Changed sprintf to safer snprintf 1744/head
Sean McBride [Wed, 22 Jun 2022 16:22:42 +0000 (12:22 -0400)] 
Fixed issue #1743: Changed sprintf to safer snprintf

Also changed a few vsprintf to vsnprintf.

Most cases were trivial, one private function was changed to take the buffer length, one case required some fancy arithmetic.

23 months agoMerge branch 'libarchive:master' into zstd_windows 1688/head
Alexandr Reshetnikov [Sun, 19 Jun 2022 19:10:18 +0000 (23:10 +0400)] 
Merge branch 'libarchive:master' into zstd_windows

23 months agoMerge pull request #1729 from bog-dan-ro/fix_comiple_android
Martin Matuška [Sun, 19 Jun 2022 06:36:18 +0000 (08:36 +0200)] 
Merge pull request #1729 from bog-dan-ro/fix_comiple_android

Fix compile on Android

23 months agoMerge pull request #1732 from asuka-mio/master
Martin Matuška [Sun, 19 Jun 2022 06:33:03 +0000 (08:33 +0200)] 
Merge pull request #1732 from asuka-mio/master

Bionic c deprecates readdir_r too

23 months agoMerge pull request #1742 from emaste/master
Martin Matuška [Sun, 19 Jun 2022 06:27:38 +0000 (08:27 +0200)] 
Merge pull request #1742 from emaste/master

CI: update FreeBSD versions

23 months agoMerge branch 'libarchive:master' into zstd_windows
Alexandr Reshetnikov [Fri, 17 Jun 2022 16:21:33 +0000 (20:21 +0400)] 
Merge branch 'libarchive:master' into zstd_windows

23 months agoCI: update FreeBSD versions 1742/head
Ed Maste [Wed, 15 Jun 2022 17:01:05 +0000 (13:01 -0400)] 
CI: update FreeBSD versions

Update to latest released versions (12.3 and 13.1), and drop now-EOL 11.4.

23 months agoMerge pull request #1739 from janstary/width
Tim Kientzle [Sun, 5 Jun 2022 23:45:04 +0000 (16:45 -0700)] 
Merge pull request #1739 from janstary/width

fix Bl -width

23 months agofix Bl -width 1739/head
Jan Starý [Sun, 5 Jun 2022 21:02:05 +0000 (23:02 +0200)] 
fix Bl -width

2 years agoMerge pull request #1724 from elieux-contrib/wincrypto-sha256-384-512-fix
Martin Matuška [Sun, 29 May 2022 07:35:22 +0000 (09:35 +0200)] 
Merge pull request #1724 from elieux-contrib/wincrypto-sha256-384-512-fix

archive_digest: Use correct providers with Windows Crypto

2 years agoMerge pull request #1730 from gportay/fix-documentation
Martin Matuška [Sun, 29 May 2022 07:33:28 +0000 (09:33 +0200)] 
Merge pull request #1730 from gportay/fix-documentation

archive_write_open.3, archive_read_open.3: ends

2 years agoBionic c deprecates readdir_r too 1732/head
tarsin [Sat, 21 May 2022 12:44:30 +0000 (20:44 +0800)] 
Bionic c deprecates readdir_r too

* See https://android.googlesource.com/platform/bionic/+/f19af37b5ee6cd5283683195d692fe3f713db2a5

2 years agoFix compile on Android 1729/head
BogDan Vatra [Tue, 3 May 2022 10:16:07 +0000 (13:16 +0300)] 
Fix compile on Android

Fixes: #890
2 years agoarchive_write_open.3, archive_read_open.3: ends 1730/head
Gaël PORTAY [Thu, 12 May 2022 08:00:38 +0000 (10:00 +0200)] 
archive_write_open.3, archive_read_open.3: ends

2 years agoMerge remote-tracking branch 'remotes/origin/master' into zstd_windows
Reshetnikov Alexandr [Thu, 28 Apr 2022 19:35:05 +0000 (23:35 +0400)] 
Merge remote-tracking branch 'remotes/origin/master' into zstd_windows

2 years agoarchive_digest: Use correct providers with Windows Crypto 1724/head
David Macek [Sun, 17 Apr 2022 17:52:25 +0000 (19:52 +0200)] 
archive_digest: Use correct providers with Windows Crypto

Trying to use SHA256, SHA384 or SHA512 with mtree when linked against
Windows Crypto would result in silent failure.  The call to
`CryptCreateHash` would fail with 0x80090008.  The docs[1] say that
these algorithms require a different crypto provider, so let's make
that a parameter for `win_crypto_init` and choose at the call site along
with the algorithm.

[1] https://docs.microsoft.com/en-us/windows/win32/seccrypto/alg-id

Signed-off-by: David Macek <david.macek.0@gmail.com>
2 years agoMerge pull request #1723 from Biswa96/win32-static-openssl
Martin Matuška [Sat, 16 Apr 2022 11:05:02 +0000 (13:05 +0200)] 
Merge pull request #1723 from Biswa96/win32-static-openssl

autotools: Fix static linking when openssl is enabled in windows

2 years agoautotools: Fix static linking when openssl is enabled in windows 1723/head
Biswapriyo Nath [Wed, 13 Apr 2022 04:18:44 +0000 (09:48 +0530)] 
autotools: Fix static linking when openssl is enabled in windows

This adds Requires.private field in pkgconfig file. Using that field,
pkgconfig pulls all the private cflags or libs while static linking.
OpenSSL static libraries require some windows system libraies. Otherwise
static liking fails with libarchive.

2 years agoMerge remote-tracking branch 'remotes/origin/master' into zstd_windows
Reshetnikov Alexandr [Tue, 12 Apr 2022 09:48:51 +0000 (13:48 +0400)] 
Merge remote-tracking branch 'remotes/origin/master' into zstd_windows

# Conflicts:
# build/ci/github_actions/ci.cmd

2 years agoMerge pull request #1714 from Biswa96/win32-openssl
Martin Matuška [Mon, 11 Apr 2022 14:27:45 +0000 (16:27 +0200)] 
Merge pull request #1714 from Biswa96/win32-openssl

Revert "Fix check for openssl on Windows"

2 years agoMerge pull request #1720 from eworm-de/markdown
Martin Matuška [Mon, 11 Apr 2022 14:26:25 +0000 (16:26 +0200)] 
Merge pull request #1720 from eworm-de/markdown

README: fix markdown syntax

2 years agoRevert "Fix check for openssl on Windows" 1714/head
Biswapriyo Nath [Sun, 3 Apr 2022 08:54:04 +0000 (14:24 +0530)] 
Revert "Fix check for openssl on Windows"

This reverts commit 045e5c5a4460020e513516a5d1f3087094e67da3
For Windows platform, openssl 1.0.2 and earlier versions have
eay64 and eay32 libraries[1]. But from openssl 1.1.0 and above
versions have same library name[2] (libcrypto and libssl) like
other unix-like platforms.

[1]: https://wiki.openssl.org/index.php/Compilation_and_Installation#OpenSSL_1.0.2
[2]: https://wiki.openssl.org/index.php/Compilation_and_Installation#OpenSSL_1.1.0

2 years agoREADME: fix markdown syntax 1720/head
Christian Hesse [Fri, 8 Apr 2022 19:52:05 +0000 (21:52 +0200)] 
README: fix markdown syntax

Some markdown implementations (python-markdown) require an empty line
before lists, so just add these.

2 years agoLibarchive 3.6.2dev
Martin Matuska [Fri, 8 Apr 2022 12:47:05 +0000 (14:47 +0200)] 
Libarchive 3.6.2dev

2 years agoCI: Update dependencies for Windows build v3.6.1
Martin Matuska [Fri, 8 Apr 2022 11:13:17 +0000 (13:13 +0200)] 
CI: Update dependencies for Windows build

Upgrade zlib to 1.2.12
Upgrade bzip2 to 10fe37f2e

2 years agoRelease 3.6.1
Martin Matuska [Fri, 8 Apr 2022 10:05:45 +0000 (12:05 +0200)] 
Release 3.6.1

2 years agoMerge pull request #1717 from evelikov/ssl
Martin Matuška [Wed, 6 Apr 2022 23:28:08 +0000 (01:28 +0200)] 
Merge pull request #1717 from evelikov/ssl

archive_digest: check return value of EVP_DigestInit()

2 years agoarchive_digest: check return value of EVP_DigestInit() 1717/head
Emil Velikov [Tue, 5 Apr 2022 10:36:02 +0000 (11:36 +0100)] 
archive_digest: check return value of EVP_DigestInit()

The function returns 0 on error, which is seemingly very common with
OpenSSL 3.0 and rmd160.

Just error check the lot, so we don't get even more random failures with
future releases of OpenSSL.

Fixes #1549

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2 years agoRAR reader: fix heap-use-after-free in run_filters()
Martin Matuska [Sun, 3 Apr 2022 10:06:24 +0000 (12:06 +0200)] 
RAR reader: fix heap-use-after-free in run_filters()

OSS-Fuzz issue 46279
Fixes #1715

2 years agoinclude zstd 1.5.2 on windows builds
Reshetnikov Alexandr [Thu, 31 Mar 2022 19:15:03 +0000 (23:15 +0400)] 
include zstd 1.5.2 on windows builds

2 years agoISO reader: fix possible heap buffer overflow in read_children()
Martin Matuska [Wed, 30 Mar 2022 19:14:00 +0000 (21:14 +0200)] 
ISO reader: fix possible heap buffer overflow in read_children()

OSS-Fuzz issue: 38764
Fixes #1685

2 years agoZIP reader: fix possible out-of-bounds read in zipx_lzma_alone_init()
Tim Kientzle [Thu, 24 Mar 2022 09:35:00 +0000 (10:35 +0100)] 
ZIP reader: fix possible out-of-bounds read in zipx_lzma_alone_init()

Fixes #1672

2 years agoMerge pull request #1679 from michael-o/hp-ux-dirfd
Martin Matuška [Sat, 12 Mar 2022 09:19:16 +0000 (10:19 +0100)] 
Merge pull request #1679 from michael-o/hp-ux-dirfd

Add macro for dirfd() on HP-UX because no full POSIX.1-2008 coverage …

2 years agoAdd macro for dirfd() on HP-UX because no full POSIX.1-2008 coverage exists 1679/head
Michael Osipov [Thu, 10 Mar 2022 11:56:02 +0000 (12:56 +0100)] 
Add macro for dirfd() on HP-UX because no full POSIX.1-2008 coverage exists

HP-UX does neither provide a function nor a macro. This solution based on an
issue with vim: https://github.com/vim/vim/issues/6838

2 years agobuild: fix detection of readdir_r() and dirfd() in configure.ac
Martin Matuska [Thu, 10 Mar 2022 10:00:26 +0000 (11:00 +0100)] 
build: fix detection of readdir_r() and dirfd() in configure.ac

Fixes #1537

2 years agoMerge pull request #1676 from ken-matsui/patch-2
Tim Kientzle [Sat, 5 Mar 2022 17:45:01 +0000 (09:45 -0800)] 
Merge pull request #1676 from ken-matsui/patch-2

Remove the unused variable `detected_bytes`

2 years agoRemove the unused variable `detected_bytes` 1676/head
Ken Matsui [Sat, 5 Mar 2022 03:12:09 +0000 (12:12 +0900)] 
Remove the unused variable `detected_bytes`

2 years agoMerge pull request #1674 from 0mp/patch-1
Tim Kientzle [Fri, 4 Mar 2022 05:15:53 +0000 (21:15 -0800)] 
Merge pull request #1674 from 0mp/patch-1

Fix use of At mdoc(7) macro

2 years agoFix use of At mdoc(7) macro 1674/head
Mateusz Piotrowski [Thu, 3 Mar 2022 23:01:40 +0000 (00:01 +0100)] 
Fix use of At mdoc(7) macro

2 years agoRAR reader: fix null-dereference in RAR (v4) filter code
Martin Matuska [Sat, 19 Feb 2022 19:43:22 +0000 (20:43 +0100)] 
RAR reader: fix null-dereference in RAR (v4) filter code

Add safety check to run_filters() and fix return codes

Reported-by: OSS-Fuzz #44843
2 years ago7zip reader: style fixes after 3962d596d
Martin Matuska [Fri, 18 Feb 2022 23:38:53 +0000 (00:38 +0100)] 
7zip reader: style fixes after 3962d596d

2 years agoMerge pull request #1670 from bradking/include-platform-first
Martin Matuška [Fri, 18 Feb 2022 23:36:52 +0000 (00:36 +0100)] 
Merge pull request #1670 from bradking/include-platform-first

windows: include archive_platform.h first in blake2s sources

2 years agoMerge pull request #1668 from mgorny/missing-zlib
Martin Matuška [Fri, 18 Feb 2022 23:36:32 +0000 (00:36 +0100)] 
Merge pull request #1668 from mgorny/missing-zlib

Fix some test failures when building --without-zlib

2 years agoMerge pull request #1671 from cielavenir/fix7zPPMDReadBeyondBoundary
Martin Matuška [Fri, 18 Feb 2022 23:35:44 +0000 (00:35 +0100)] 
Merge pull request #1671 from cielavenir/fix7zPPMDReadBeyondBoundary

Fix 7z PPMD reading beyond boundary

2 years agocode review 1671/head
cielavenir [Fri, 18 Feb 2022 15:23:16 +0000 (00:23 +0900)] 
code review

2 years agoFix 7z PPMD reading beyond boundary
cielavenir [Fri, 18 Feb 2022 09:19:12 +0000 (18:19 +0900)] 
Fix 7z PPMD reading beyond boundary

2 years agoci (GitHub Actions): build on Windows 2022 and use Visual Studio 17 2022
Martin Matuska [Thu, 17 Feb 2022 16:09:00 +0000 (17:09 +0100)] 
ci (GitHub Actions): build on Windows 2022 and use Visual Studio 17 2022

2 years agoRAR reader: fix heap-use-after-free in RAR (v4) filter code
Martin Matuska [Wed, 16 Feb 2022 20:36:41 +0000 (21:36 +0100)] 
RAR reader: fix heap-use-after-free in RAR (v4) filter code

Rework function expand() to process integer passed by reference
and return an archive error code.

Fixes: 01a2d329dfc7 (support rar filters)
Reported-by: OSS-Fuzz #44547
2 years agowindows: include archive_platform.h first in blake2s sources 1670/head
Brad King [Wed, 16 Feb 2022 12:31:56 +0000 (07:31 -0500)] 
windows: include archive_platform.h first in blake2s sources

Move the inclusion added by commit 90978db1 (windows: make sure we use
the right calling convention for libc, 2021-10-13, v3.6.0~39^2~1) to be
first.  This is our convention in all other `.c` sources.  It ensures
that our configured `_WIN32_WINNT` value is defined before including any
system headers.

2 years agotests: reduce sample size for RAR filter test
Martin Matuska [Mon, 14 Feb 2022 00:08:46 +0000 (01:08 +0100)] 
tests: reduce sample size for RAR filter test

2 years agoLibarchive 3.6.1dev
Martin Matuska [Mon, 14 Feb 2022 00:13:03 +0000 (01:13 +0100)] 
Libarchive 3.6.1dev

2 years agoHandle missing zlib in test_read_format_zip_7z_deflate 1668/head
Michał Górny [Sat, 12 Feb 2022 10:12:27 +0000 (11:12 +0100)] 
Handle missing zlib in test_read_format_zip_7z_deflate

2 years agoFix expected error messages in test_read_format_zip_winzip_aes*
Michał Górny [Sat, 12 Feb 2022 10:11:22 +0000 (11:11 +0100)] 
Fix expected error messages in test_read_format_zip_winzip_aes*

Fix expected error messages when libarchive is compiled --without-zlib,
in order to fix test failures.

2 years agoRelease 3.6.0 v3.6.0
Martin Matuska [Wed, 9 Feb 2022 08:41:14 +0000 (09:41 +0100)] 
Release 3.6.0

2 years agoMerge pull request #1665 from juikim/master
Martin Matuška [Wed, 9 Feb 2022 07:35:52 +0000 (08:35 +0100)] 
Merge pull request #1665 from juikim/master

bsdtar(1): Document threads options for zstd and xz

2 years agobsdtar(1): Document threads options for zstd and xz 1665/head
Jung-uk Kim [Wed, 9 Feb 2022 03:03:05 +0000 (22:03 -0500)] 
bsdtar(1): Document threads options for zstd and xz

2 years agoLibarchive 3.6.0dev
Martin Matuska [Tue, 8 Feb 2022 09:47:31 +0000 (10:47 +0100)] 
Libarchive 3.6.0dev

2 years agoCI: add dist-artifact
Martin Matuska [Tue, 8 Feb 2022 08:23:37 +0000 (09:23 +0100)] 
CI: add dist-artifact

2 years agotests: fix style in test_utils/test_main.c
Martin Matuska [Tue, 8 Feb 2022 07:27:11 +0000 (08:27 +0100)] 
tests: fix style in test_utils/test_main.c

2 years agoMerge pull request #1657 from kientzle/ReorganizeTestCode
Martin Matuška [Tue, 8 Feb 2022 07:25:55 +0000 (08:25 +0100)] 
Merge pull request #1657 from kientzle/ReorganizeTestCode

Reorganize test code a bit

2 years agoMerge pull request #1664 from juikim/master
Martin Matuška [Tue, 8 Feb 2022 07:25:23 +0000 (08:25 +0100)] 
Merge pull request #1664 from juikim/master

Enable LZMA support for FreeBSD

2 years agoMerge pull request #1493 from antekone/rar5_ossfuzz_30459
Martin Matuška [Tue, 8 Feb 2022 07:16:45 +0000 (08:16 +0100)] 
Merge pull request #1493 from antekone/rar5_ossfuzz_30459

RAR5 reader: add more checks for invalid extraction parameters

2 years agoRAR5 reader: add more checks for invalid extraction parameters 1493/head
Grzegorz Antoniak [Sat, 13 Feb 2021 09:13:22 +0000 (10:13 +0100)] 
RAR5 reader: add more checks for invalid extraction parameters

Some specially crafted files declare invalid extraction parameters that
can confuse the RAR5 reader.

One of the arguments is the declared window size parameter that the
archive file can declare for each file stored in the archive. Some
crafted files declare window size equal to 0, which is clearly wrong.

This commit adds additional safety checks decreasing the tolerance of
the RAR5 format.

This commit also contains OSSFuzz sample #30459.

2 years agoEnable LZMA support for FreeBSD 1664/head
Jung-uk Kim [Mon, 7 Feb 2022 21:16:34 +0000 (16:16 -0500)] 
Enable LZMA support for FreeBSD

All supported FreeBSD releases have LZMA by default.

2 years agoMerge pull request #1663 from yelkarama/master
Martin Matuška [Mon, 7 Feb 2022 19:59:23 +0000 (20:59 +0100)] 
Merge pull request #1663 from yelkarama/master

Fix typo in libarchive/archive_read_support_filter_lzop.c

2 years agoFix typo in libarchive/archive_read_support_filter_lzop.c 1663/head
Younes El-karama [Mon, 7 Feb 2022 16:30:40 +0000 (11:30 -0500)] 
Fix typo in libarchive/archive_read_support_filter_lzop.c

Extra "dot" in line 176 of libarchive/archive_read_support_filter_lzop.c

2 years agountar.c: style fixes
Martin Matuska [Mon, 7 Feb 2022 09:48:51 +0000 (10:48 +0100)] 
untar.c: style fixes

2 years agotar: fix format name typo in creation_set.c
Martin Matuska [Mon, 7 Feb 2022 08:23:41 +0000 (09:23 +0100)] 
tar: fix format name typo in creation_set.c

Closes #1659

2 years agoMerge pull request #1170 from kidandcat/patch-1
Martin Matuška [Sun, 6 Feb 2022 23:59:09 +0000 (00:59 +0100)] 
Merge pull request #1170 from kidandcat/patch-1

Windows support for contrib/untar

2 years agoUpdate untar.c 1170/head
Jairo [Sun, 6 Feb 2022 23:13:18 +0000 (00:13 +0100)] 
Update untar.c

2 years agoUpdate untar.c
Jairo [Sun, 6 Feb 2022 23:11:02 +0000 (00:11 +0100)] 
Update untar.c

2 years agoMerge pull request #1491 from antekone/rar5_ossfuzz_30442
Martin Matuška [Sun, 6 Feb 2022 18:35:30 +0000 (19:35 +0100)] 
Merge pull request #1491 from antekone/rar5_ossfuzz_30442

RAR5 reader: fix invalid memory access in some files

2 years agoRAR5 reader: fix invalid memory access in some files 1491/head
Grzegorz Antoniak [Fri, 12 Feb 2021 19:18:31 +0000 (20:18 +0100)] 
RAR5 reader: fix invalid memory access in some files

RAR5 reader uses several variables to manage the window buffer during
extraction: the buffer itself (`window_buf`), the current size of the
window buffer (`window_size`), and a helper variable (`window_mask`)
that is used to constrain read and write offsets to the window buffer.

Some specially crafted files can force the unpacker to update the
`window_mask` variable to a value that is out of sync with current
buffer size. If the `window_mask` will be bigger than the actual buffer
size, then an invalid access operation can happen (SIGSEGV).

This commit ensures that if the `window_size` and `window_mask` will be
changed, the window buffer will be reallocated to the proper size, so no
invalid memory operation should be possible.

This commit contains a test file from OSSFuzz #30442.

2 years agoMerge pull request #1448 from arichardson/add-test-slow-host
Martin Matuška [Sun, 6 Feb 2022 10:29:22 +0000 (11:29 +0100)] 
Merge pull request #1448 from arichardson/add-test-slow-host

Reduce test_write_format_7zip_large_lzma1 buffer size

2 years agoMerge pull request #1655 from alexey-pelykh/fix-android_lf-include
Martin Matuška [Sun, 6 Feb 2022 08:49:28 +0000 (09:49 +0100)] 
Merge pull request #1655 from alexey-pelykh/fix-android_lf-include

Include android_lf.h only for libarchive sources

2 years agozip: fix possible endless loop if reading a truncated zstd archive
Martin Matuska [Sat, 5 Feb 2022 20:02:13 +0000 (21:02 +0100)] 
zip: fix possible endless loop if reading a truncated zstd archive

The fix is analogous to the behavior in case of bzip2 compression.

2 years agodist: add missing zipx-zstd test files to Makefile.am
Martin Matuska [Sat, 5 Feb 2022 09:45:32 +0000 (10:45 +0100)] 
dist: add missing zipx-zstd test files to Makefile.am

2 years agoMerge pull request #1518 from ghost/zip-zstd
Martin Matuška [Sat, 5 Feb 2022 09:32:21 +0000 (10:32 +0100)] 
Merge pull request #1518 from ghost/zip-zstd

ZIP reader: added support for Zstd decompression

2 years agoMerge pull request #1603 from evelikov/reader-filter-vtbl
Martin Matuška [Sat, 5 Feb 2022 09:02:15 +0000 (10:02 +0100)] 
Merge pull request #1603 from evelikov/reader-filter-vtbl

Reader filter rework - simplification, robustness and deadcode removal

2 years agoReorganize test code a bit 1657/head
Tim Kientzle [Wed, 2 Feb 2022 03:33:41 +0000 (19:33 -0800)] 
Reorganize test code a bit

A few guiding principles:
* Each test source file includes ONLY "test.h" to make it easy
  to create new tests.
* Each test suite has a "test.h" that includes "test_util/test_common.h"
  to get access to all the common testing utility functions.

So "test_common.h" is then responsible for including
any smaller headers that declare specific pieces of
shared test functionality.

I've also pulled some test filtering logic that was _only_ used
in test_main.c into that file, and repurposed "test_utils.[ch]"
for common utility code.  (Eventually, a lot of the assertion
helpers currently in "test_main.c" should probably be organized
into one or more source files of their own.)

2 years agoMerge pull request #1438 from arichardson/faster-tests-avoid-rand
Tim Kientzle [Wed, 2 Feb 2022 03:12:35 +0000 (19:12 -0800)] 
Merge pull request #1438 from arichardson/faster-tests-avoid-rand

Avoid millions of rand() calls() when running tests

2 years agoInclude android_lf.h only for libarchive sources 1655/head
Alexey Pelykh [Sun, 23 Jan 2022 08:40:58 +0000 (09:40 +0100)] 
Include android_lf.h only for libarchive sources

2 years agoAvoid millions of rand() calls() when running tests 1438/head
Alex Richardson [Thu, 17 Sep 2020 17:28:17 +0000 (18:28 +0100)] 
Avoid millions of rand() calls() when running tests

Many tests use a loop calling rand() to fill buffers with test data. As
these calls cannot be inlined, this adds up to noticeable overhead:
For example, running on QEMU RISC-V the test_write_format_7zip_large_copy
test took ~22 seconds before and with this change it's ~17 seconds.
This change uses a simpler xorshift64 random number generator that can be
inlined into the loop filling the data buffer. By default the seed for this
RNG is rand(), but it can be overwritten by setting the TEST_RANDOM_SEED
environment variable.

For a native build the difference is much less noticeable, but it's still
measurable: test_write_format_7zip_large_copy takes 314.9 ms ± 3.9 ms
before and 227.8 ms ± 5.8 ms after (i.e. 38% faster for that test).

2 years agoMerge pull request #1492 from antekone/rar5_ossfuzz_30448
Martin Matuška [Wed, 12 Jan 2022 15:02:58 +0000 (16:02 +0100)] 
Merge pull request #1492 from antekone/rar5_ossfuzz_30448

RAR5 reader: fixed out of bounds read in some files

2 years agoMerge pull request #1653 from zzambers/sparse-8g
Tim Kientzle [Wed, 12 Jan 2022 04:35:29 +0000 (20:35 -0800)] 
Merge pull request #1653 from zzambers/sparse-8g

Fixed size attribute in pax header for large sparse files

2 years agoFixed size filed in pax header 1653/head
Zdenek Zambersky [Tue, 11 Jan 2022 13:43:27 +0000 (14:43 +0100)] 
Fixed size filed in pax header

2 years agoRAR5 reader: fixed out of bounds read in some files 1492/head
Grzegorz Antoniak [Sat, 13 Feb 2021 08:08:13 +0000 (09:08 +0100)] 
RAR5 reader: fixed out of bounds read in some files

Added more range checks in the bit stream reading functions
(read_bits_16 and read_bits_32) in order to better guard against out of
memory reads.

This commit contains a test with OSSFuzz sample #30448.

2 years agoMerge pull request #1639 from todd-richmond/master
Martin Matuška [Tue, 4 Jan 2022 00:19:07 +0000 (01:19 +0100)] 
Merge pull request #1639 from todd-richmond/master

zip size entry of -1 should be treated the same as 0

2 years agoMerge pull request #1503 from legnaleurc/rar_filter
Martin Matuška [Mon, 3 Jan 2022 11:12:05 +0000 (12:12 +0100)] 
Merge pull request #1503 from legnaleurc/rar_filter

support rar filters (without VM filter support)

2 years agoMerge pull request #1642 from goshhhy/irix-blake2
Martin Matuška [Mon, 3 Jan 2022 11:07:45 +0000 (12:07 +0100)] 
Merge pull request #1642 from goshhhy/irix-blake2

update BLAKE2_PACKED macro with a non-GCCism fallback

2 years agoMerge pull request #1625 from evelikov/gc-sections
Martin Matuška [Mon, 3 Jan 2022 11:07:13 +0000 (12:07 +0100)] 
Merge pull request #1625 from evelikov/gc-sections

Instrument gcc/clang to discard unused code during link

2 years agoMerge pull request #1643 from eworm-de/link-unescape
Martin Matuška [Mon, 3 Jan 2022 10:56:38 +0000 (11:56 +0100)] 
Merge pull request #1643 from eworm-de/link-unescape

unescape when extracting link

2 years agoMerge pull request #1645 from ppentchev/roam-lzip-large-dict
Martin Matuška [Mon, 3 Jan 2022 10:49:08 +0000 (11:49 +0100)] 
Merge pull request #1645 from ppentchev/roam-lzip-large-dict

Raise the lzip max dictionary size to 512MB.

2 years agoMerge pull request #1649 from petris/master
Martin Matuška [Mon, 3 Jan 2022 10:39:15 +0000 (11:39 +0100)] 
Merge pull request #1649 from petris/master

Support libzstd compiled with compressor disabled

2 years agoCI: fix ubuntu distcheck
Martin Matuska [Mon, 3 Jan 2022 09:23:27 +0000 (10:23 +0100)] 
CI: fix ubuntu distcheck

Add missing test_read_format_rar5_sfx.exe.uu
Be more verbose on failure

2 years agounescape when extracting link 1643/head
Christian Hesse [Mon, 20 Dec 2021 09:36:50 +0000 (10:36 +0100)] 
unescape when extracting link

The file name is escaped when archiving, so it needs to be unescaped
when extracting.

2 years agoMerge pull request #1640 from wlozano0collabora/fix-tar
Martin Matuška [Mon, 3 Jan 2022 08:41:04 +0000 (09:41 +0100)] 
Merge pull request #1640 from wlozano0collabora/fix-tar

Fix check for tape device