]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
5 years agoRAR5 reader: remove compilation warnings ('uninitialized variable') 1253/head
Grzegorz Antoniak [Fri, 27 Sep 2019 05:48:21 +0000 (07:48 +0200)] 
RAR5 reader: remove compilation warnings ('uninitialized variable')

This commit makes the compiler happy by removing some uninitialized
variable warnings/errors in RAR5 reader.

5 years agoMerge pull request #1250 from ischwarze/ischwarze-mdoc
Martin Matuška [Tue, 24 Sep 2019 20:26:09 +0000 (22:26 +0200)] 
Merge pull request #1250 from ischwarze/ischwarze-mdoc

Minor corrections to the formatting of manual pages

5 years agoMinor corrections to the formatting of manual page. 1250/head
Ingo Schwarze [Fri, 13 Sep 2019 17:55:05 +0000 (19:55 +0200)] 
Minor corrections to the formatting of manual page.

Found with mandoc -Tlint; fixing the following messages:

WARNING: bad NAME section content
WARNING: missing comma before name
WARNING: new sentence, new line
WARNING: parenthesis in function name
WARNING: skipping no-space macro
WARNING: skipping paragraph macro
WARNING: unusual Xr order
WARNING: unusual Xr punctuation
STYLE: no blank before trailing delimiter
STYLE: possible typo in section name
STYLE: trailing delimiter
STYLE: whitespace at end of input line

For the meaning of the messages, see:
https://man.openbsd.org/mandoc#DIAGNOSTICS

5 years agoMerge pull request #1249 from ppentchev/roam-typos 1247/head
Martin Matuška [Sat, 21 Sep 2019 06:59:17 +0000 (08:59 +0200)] 
Merge pull request #1249 from ppentchev/roam-typos

Correct some typographical and grammatical errors.

5 years agoCorrect some typographical and grammatical errors. 1249/head
Peter Pentchev [Fri, 20 Sep 2019 22:33:19 +0000 (01:33 +0300)] 
Correct some typographical and grammatical errors.

5 years agoGithub Actions: update to matrix build with autotools and cmake
Martin Matuska [Tue, 10 Sep 2019 15:15:47 +0000 (17:15 +0200)] 
Github Actions: update to matrix build with autotools and cmake

5 years agoGithub Actions: add Ubuntu build
Martin Matuska [Tue, 10 Sep 2019 14:44:29 +0000 (16:44 +0200)] 
Github Actions: add Ubuntu build

5 years agoarchive_read_support_filter_lz4.c: use uint32_c for compressed
Martin Matuska [Tue, 3 Sep 2019 21:47:50 +0000 (23:47 +0200)] 
archive_read_support_filter_lz4.c: use uint32_c for compressed

Fixes #1237

5 years agotest_write_filter_zstd.c revert compression level to 7 (unbreaks zstd 1.3.x)
Martin Matuska [Tue, 3 Sep 2019 21:15:23 +0000 (23:15 +0200)] 
test_write_filter_zstd.c revert compression level to 7 (unbreaks zstd 1.3.x)

5 years agoMerge pull request #1230 from MaximeLM/clang_inttypes
Martin Matuška [Tue, 3 Sep 2019 20:25:06 +0000 (22:25 +0200)] 
Merge pull request #1230 from MaximeLM/clang_inttypes

Don't include inttypes if compiling for Mac/iOS

5 years agoMerge pull request #1221 from jrmarino/master
Martin Matuška [Tue, 3 Sep 2019 20:21:34 +0000 (22:21 +0200)] 
Merge pull request #1221 from jrmarino/master

Fix two tests when ZIP compression unsupported

5 years agoMerge pull request #1240 from ferdnyc/zstd-test-range
Martin Matuška [Tue, 3 Sep 2019 20:19:22 +0000 (22:19 +0200)] 
Merge pull request #1240 from ferdnyc/zstd-test-range

test_write_filter_zstd: Compare output sizes across wider range

5 years agotest_write_filter_zstd: size @ lvl=20 < default < lvl=1 1240/head
FeRD (Frank Dana) [Sun, 1 Sep 2019 06:46:55 +0000 (02:46 -0400)] 
test_write_filter_zstd: size @ lvl=20 < default < lvl=1

Raise compression on the second test to level=20, and perform a
third at level=1. Expect the output archive sizes to line up
based on compression level. Reduces test susceptibility to small
output size variations from different libzstd releases.

5 years agoCorrect invalid function call in la_opendirat()
Martin Matuska [Sun, 1 Sep 2019 08:48:33 +0000 (10:48 +0200)] 
Correct invalid function call in la_opendirat()

Fixes #1239

5 years agoDon't include inttypes if compiling for Mac/iOS 1230/head
Maxime Le Moine [Fri, 26 Jul 2019 21:05:13 +0000 (23:05 +0200)] 
Don't include inttypes if compiling for Mac/iOS

5 years agoAs there is no 11.3 FreeBSD image at Cirrus CI yet, revert to 11.2
Martin Matuska [Mon, 12 Aug 2019 10:35:44 +0000 (12:35 +0200)] 
As there is no 11.3 FreeBSD image at Cirrus CI yet, revert to 11.2

5 years agoCirrus CI: set CFLAGS and LDFLAGS for FreeBSD
Martin Matuska [Sun, 11 Aug 2019 22:20:31 +0000 (00:20 +0200)] 
Cirrus CI: set CFLAGS and LDFLAGS for FreeBSD

5 years agotest_write_filter_zstd: set compression level to 7
Martin Matuska [Sun, 11 Aug 2019 22:14:00 +0000 (00:14 +0200)] 
test_write_filter_zstd: set compression level to 7

Fixes #1226

6 years agoUpdate option documentation for 7zip and zip options.
Joerg Sonnenberger [Sat, 27 Jul 2019 21:18:57 +0000 (23:18 +0200)] 
Update option documentation for 7zip and zip options.

6 years agoFix two tests when ZIP compression unsupported 1221/head
John Marino [Sat, 6 Jul 2019 16:17:31 +0000 (11:17 -0500)] 
Fix two tests when ZIP compression unsupported

6 years agoUnbreak compilation without zlib
Martin Matuska [Fri, 28 Jun 2019 22:20:58 +0000 (00:20 +0200)] 
Unbreak compilation without zlib

Fixes #1214

6 years agoMerge pull request #1218 from dtor/fix-sparse-read
Martin Matuška [Thu, 27 Jun 2019 13:13:47 +0000 (15:13 +0200)] 
Merge pull request #1218 from dtor/fix-sparse-read

Fixes to handling sparse files

6 years agoMerge pull request #1217 from antekone/rar5_arm_filter_on_window_boundary
Martin Matuška [Thu, 27 Jun 2019 13:07:35 +0000 (15:07 +0200)] 
Merge pull request #1217 from antekone/rar5_arm_filter_on_window_boundary

RAR5 reader: fix ARM filter going beyond window buffer boundary

6 years agoarchive_read_next_header2: clean old entry data 1218/head
Dmitry Torokhov [Tue, 25 Jun 2019 22:17:52 +0000 (15:17 -0700)] 
archive_read_next_header2: clean old entry data

We need to clean old entry data in archive_read_next_header2 in Windows
and Posix disk readers to ensure consistent results. One possible
failure mode: sparse data from the previous entry is carried over to
next non-sparse file entry, causing it to be mishandled.

6 years agoarchive_read: fix handling of sparse files
Dmitry Torokhov [Tue, 25 Jun 2019 17:09:44 +0000 (10:09 -0700)] 
archive_read: fix handling of sparse files

If a file ends with a sparse "hole" that is larger than buffer supplied
to archive_read(), then archive_read() will return prematurely because
archive_read_data_block() will return ARHCIVE_EOF as there is no more
"real" data. We can fix that by not trying to refill data buffer until
we exhaust the hole range.

Fixes libarchive#1194

6 years agoRAR5 reader: fix ARM filter going beyond window buffer boundary 1217/head
Grzegorz Antoniak [Mon, 24 Jun 2019 05:07:02 +0000 (07:07 +0200)] 
RAR5 reader: fix ARM filter going beyond window buffer boundary

RAR5 uses filters in order to mutate data just before compression, to
achieve a better compression ratio. After decompression, this mutation
needs to be reversed by processing various filters that the compressor
uses.

One of such filters is an ARM executable file filter, which changes some
bytes in the input stream if the stream is recognized as an executable
file with ARM native code.

This commit fixes the situation when the decompressor using an ARM filter
was referencing a byte outside current window buffer. Such action is
invalid and can produce segmentation faults.

This commit also adds a test using OSSFuzz sample #15431.

6 years agoCI: upgrade Fedora from 29 to 30, remove unmaintained MacOS High Sierra
Martin Matuska [Mon, 17 Jun 2019 13:19:53 +0000 (15:19 +0200)] 
CI: upgrade Fedora from 29 to 30, remove unmaintained MacOS High Sierra

6 years agoMerge pull request #1212 from antekone/rar5_different_window_size
Martin Matuska [Mon, 17 Jun 2019 10:27:09 +0000 (12:27 +0200)] 
Merge pull request #1212 from antekone/rar5_different_window_size

RAR5 reader: window_mask was not updated correctly

6 years agoAdd test_read_format_rar5_different_window_size.rar.uu to Makefile.am
Martin Matuska [Mon, 17 Jun 2019 10:26:38 +0000 (12:26 +0200)] 
Add test_read_format_rar5_different_window_size.rar.uu to Makefile.am

6 years agoRAR5 reader: window_mask was not updated correctly 1212/head
Grzegorz Antoniak [Sun, 16 Jun 2019 07:49:05 +0000 (09:49 +0200)] 
RAR5 reader: window_mask was not updated correctly

The `window_mask` variable should be always in sync with the
`window_size` variable.

The commit fixes a bug in which there was one place that `window_size`
was modified, but `window_mask` wasn't updated. This was leading to a
SIGSEGV error, because by having wrong `window_mask`, RAR5 reader was
accessing the memory outsize current window buffer.

The commit also adds a test for this issue, together with OSSFuzz
sample #15278.

6 years agoAdd EOF test to test_read_format_rar_ppmd_use_after_free
Martin Matuska [Sat, 15 Jun 2019 21:00:51 +0000 (23:00 +0200)] 
Add EOF test to test_read_format_rar_ppmd_use_after_free
and test_read_format_rar_ppmd_use_after_free2

6 years agoRAR reader: extend fix user after free
Martin Matuska [Sat, 15 Jun 2019 20:32:35 +0000 (22:32 +0200)] 
RAR reader: extend fix user after free

If read_data_compressed() returns ARCHIVE_FAILED, the caller is allowed
to continue with next archive headers. In addition to
rar->start_new_table=1 we need to set rar->ppmd_valid=0.

Reported by: OSS-Fuzz issue 15120

6 years agoAdd HAVE_UNLINKAT to libarchive/config_freebsd.h
Martin Matuska [Tue, 11 Jun 2019 23:53:31 +0000 (01:53 +0200)] 
Add HAVE_UNLINKAT to libarchive/config_freebsd.h

6 years agoPartially revert 6aea568d87025b0a441388e9394d9084fa0a57c3
Martin Matuska [Tue, 11 Jun 2019 22:16:31 +0000 (00:16 +0200)] 
Partially revert 6aea568d87025b0a441388e9394d9084fa0a57c3

On most platforms it is impossible to open a fd on symbolic links.

6 years agoSet up 3.4.1dev
Martin Matuska [Tue, 11 Jun 2019 21:57:21 +0000 (23:57 +0200)] 
Set up 3.4.1dev

6 years ago3.4.0 v3.4.0
Martin Matuska [Tue, 11 Jun 2019 19:53:23 +0000 (21:53 +0200)] 
3.4.0

6 years agoRemove unused members of struct lafe_line_reader
Marc Espie [Tue, 11 Jun 2019 00:01:26 +0000 (02:01 +0200)] 
Remove unused members of struct lafe_line_reader

Fixes #1211

6 years agoUpdate specfile to a version usable on copr
Martin Matuska [Mon, 10 Jun 2019 21:27:33 +0000 (23:27 +0200)] 
Update specfile to a version usable on copr

6 years agoMerge lib/libc/gen/readpassphrase.c v 1.27 from OpenBSD
Martin Matuska [Sun, 9 Jun 2019 23:31:56 +0000 (01:31 +0200)] 
Merge lib/libc/gen/readpassphrase.c v 1.27 from OpenBSD

Fixes #1209

6 years agoarchive_write_disk_posix changes
Martin Matuska [Thu, 6 Jun 2019 13:12:11 +0000 (15:12 +0200)] 
archive_write_disk_posix changes
- private file descriptor in _archive_write_disk_close()
- use la_opendirat() in edit_deep_directories()

6 years agoFix typo in tar/bsdtar.1
Martin Matuska [Thu, 6 Jun 2019 12:58:25 +0000 (14:58 +0200)] 
Fix typo in tar/bsdtar.1

6 years agoMore bsdtar.1 manpage fixes
Martin Matuska [Mon, 3 Jun 2019 21:51:44 +0000 (23:51 +0200)] 
More bsdtar.1 manpage fixes

- use term "extended file attributes"
- use term "file attributes or file flags"

6 years agoMinor bsdtar.1 manpage fixes
Martin Matuska [Mon, 3 Jun 2019 21:33:49 +0000 (23:33 +0200)] 
Minor bsdtar.1 manpage fixes

- the -p option does not restore owner by default.
- the -n option was listed twice
- file flags are called file attributes on Linux and are platform-specific

Fixes #1204

6 years agoAdd missing HAVE_UNLINKAT to build/cmake/config.h.in
Martin Matuska [Mon, 3 Jun 2019 14:29:58 +0000 (16:29 +0200)] 
Add missing HAVE_UNLINKAT to build/cmake/config.h.in

6 years agoFix typo in CMakeLists.txt and build/ci/build.sh
Martin Matuska [Fri, 31 May 2019 22:49:48 +0000 (00:49 +0200)] 
Fix typo in CMakeLists.txt and build/ci/build.sh

6 years agoarchive_write_disk: remove some obsolete TODO comments
Martin Matuska [Sun, 26 May 2019 00:21:51 +0000 (02:21 +0200)] 
archive_write_disk: remove some obsolete TODO comments

6 years agoarchive_write_disk_posix: check_symlinks_fsobj() without chdir()
Martin Matuska [Sat, 25 May 2019 23:48:39 +0000 (01:48 +0200)] 
archive_write_disk_posix: check_symlinks_fsobj() without chdir()

only on platforms with openat(), fstatat() and unlinkat() support

6 years agoarchive_write_disk_posix: open a fd when processing fixup entries
Martin Matuska [Sat, 25 May 2019 21:46:59 +0000 (23:46 +0200)] 
archive_write_disk_posix: open a fd when processing fixup entries

6 years agoarchive_write_disk_posix: simplify set_mode()
Martin Matuska [Sat, 25 May 2019 21:20:21 +0000 (23:20 +0200)] 
archive_write_disk_posix: simplify set_mode()

Try fchmod() first when setting mode on links

6 years agoMerge pull request #1205 from vapier/master
Martin Matuška [Thu, 23 May 2019 13:20:01 +0000 (15:20 +0200)] 
Merge pull request #1205 from vapier/master

simplify gitignore a bit

6 years agosimplify gitignore a bit 1205/head
Mike Frysinger [Wed, 22 May 2019 04:04:35 +0000 (09:49 +0545)] 
simplify gitignore a bit

Lets ignore autotool generated files (.la .dirstamp .deps) everywhere
rather than hardcoded specific subdirs.  We'll never add files with
those names to the source repo, so that should be OK.

We're already ignoring CMakeFiles/ everywhere (since the rule lacks
a leading / anchor), so we can delete the redundant paths.

Rather than hardcode every possible unittest and related files, add
globs that ignore all *_test related paths in the topdir.  We won't
be adding paths like that to the source repo, so it should be OK.

6 years agoMerge pull request #1202 from bradking/rename-b64-encode
Martin Matuška [Tue, 21 May 2019 14:39:21 +0000 (16:39 +0200)] 
Merge pull request #1202 from bradking/rename-b64-encode

b64encode: avoid name conflict with Solaris built-in function

6 years agob64encode: avoid name conflict with Solaris built-in function 1202/head
Brad King [Tue, 21 May 2019 11:43:39 +0000 (07:43 -0400)] 
b64encode: avoid name conflict with Solaris built-in function

Solaris 11.4 has a built-in function named `b64_encode`.  Add a
`la_` prefix to our internal function to avoid conflict.

6 years agocontrib/archivetest: report archive_error_string() on error
Martin Matuska [Mon, 20 May 2019 11:24:59 +0000 (13:24 +0200)] 
contrib/archivetest: report archive_error_string() on error

6 years agoarchive_read_support_format_zip.c: wrap to 80 chars per line (where possible)
Martin Matuska [Mon, 20 May 2019 09:54:19 +0000 (11:54 +0200)] 
archive_read_support_format_zip.c: wrap to 80 chars per line (where possible)

6 years agoMerge pull request #1201 from vapier/master
Martin Matuška [Sun, 19 May 2019 20:23:09 +0000 (22:23 +0200)] 
Merge pull request #1201 from vapier/master

zip: check filename crc in Info-ZIP Unicode Path Extra Field

6 years agoMerge pull request #1074 from ice799/consume_padding
Martin Matuška [Sat, 18 May 2019 21:49:56 +0000 (23:49 +0200)] 
Merge pull request #1074 from ice799/consume_padding

Handle ZIP files with trailing 0s in the extra fields

TODO: test

Fixes #1114
Fixes #1056

6 years agoMerge pull request #1109 from kientzle/Issue1055
Martin Matuška [Sat, 18 May 2019 21:07:38 +0000 (23:07 +0200)] 
Merge pull request #1109 from kientzle/Issue1055

Issue #1055: Ignore padding in Zip extra field data

6 years agotar reader: treat empty archives with a GNU volume header as valid
Martin Matuska [Sat, 18 May 2019 08:19:19 +0000 (10:19 +0200)] 
tar reader: treat empty archives with a GNU volume header as valid

Fixes #1062

6 years agozip: check filename crc in Info-ZIP Unicode Path Extra Field 1201/head
Mike Frysinger [Fri, 17 May 2019 10:53:18 +0000 (22:53 +1200)] 
zip: check filename crc in Info-ZIP Unicode Path Extra Field

The 0x7075 extension includes a crc of the filename that's in the CDE
to make sure that the UTF8 string is always up to date.  If an older
tool updates the CDE but doesn't update the 0x7075 field, we want to
ignore the UTF8 string since it's stale.

6 years agocontrib/archivetest: add help, support stdin, quiet mode and data skip mode
Martin Matuska [Fri, 17 May 2019 10:02:40 +0000 (12:02 +0200)] 
contrib/archivetest: add help, support stdin, quiet mode and data skip mode

6 years agoAdd contrib/archivetest.c utility to test archives with libarchive
Martin Matuska [Thu, 16 May 2019 12:59:04 +0000 (14:59 +0200)] 
Add contrib/archivetest.c utility to test archives with libarchive

6 years agoXar reader: do not try to add xattrs without an allocated name
Martin Matuska [Thu, 16 May 2019 11:48:01 +0000 (13:48 +0200)] 
Xar reader: do not try to add xattrs without an allocated name

Fixes #795

6 years agoAdd test_read_format_rar_ppmd_use_after_free.rar.uu to Makefile.am
Martin Matuska [Sun, 12 May 2019 18:32:55 +0000 (20:32 +0200)] 
Add test_read_format_rar_ppmd_use_after_free.rar.uu to Makefile.am

Entry was missing in PR #1199

6 years agoMerge pull request #1199 from antekone/rar_ppmd_use_after_free
Martin Matuska [Sun, 12 May 2019 18:31:02 +0000 (20:31 +0200)] 
Merge pull request #1199 from antekone/rar_ppmd_use_after_free

RAR reader: add a test for fix b8592ecb

6 years agoCI: process return code of "make distcheck"
Martin Matuska [Sun, 12 May 2019 17:47:12 +0000 (19:47 +0200)] 
CI: process return code of "make distcheck"

6 years agoRAR reader: add a test for fix b8592ecb 1199/head
Grzegorz Antoniak [Sun, 12 May 2019 05:41:47 +0000 (07:41 +0200)] 
RAR reader: add a test for fix b8592ecb

This commit adds an OSSFuzz sample and a test for fix from commit
b8592ecb.

6 years agoCI: add install target
Martin Matuska [Sat, 11 May 2019 22:52:23 +0000 (00:52 +0200)] 
CI: add install target

6 years agoCI: increase make command output verbosity
Martin Matuska [Sat, 11 May 2019 19:36:39 +0000 (21:36 +0200)] 
CI: increase make command output verbosity

Add Fedora_29_distcheck task with "make distcheck"
Add support for debug build with address sanitizer
Add missing free to tar/test/test_option_C_mtree.c

6 years agoAdd missing distcheck files to Makefile.am
Martin Matuska [Sat, 11 May 2019 19:25:16 +0000 (21:25 +0200)] 
Add missing distcheck files to Makefile.am

6 years agoMerge pull request #1197 from vapier/master
Martin Matuška [Sat, 11 May 2019 19:03:29 +0000 (21:03 +0200)] 
Merge pull request #1197 from vapier/master

add new raw test file to the distribution

6 years agoRAR reader: fix use after free
Martin Matuska [Sat, 11 May 2019 00:36:53 +0000 (02:36 +0200)] 
RAR reader: fix use after free

If read_data_compressed() returns ARCHIVE_FAILED, the caller is allowed
to continue with next archive headers. We need to set rar->start_new_table
after the ppmd7_context got freed, otherwise it won't be allocated again.

Reported by: OSS-Fuzz issue 2582

6 years agoFree slurpfile in test_read_format_zip_utf8_paths
Martin Matuska [Sat, 11 May 2019 00:19:55 +0000 (02:19 +0200)] 
Free slurpfile in test_read_format_zip_utf8_paths

6 years agoadd new raw test file to the distribution 1197/head
Mike Frysinger [Fri, 10 May 2019 20:14:44 +0000 (08:14 +1200)] 
add new raw test file to the distribution

6 years agoMerge pull request #1196 from antekone/rar5_verify_window_size
Martin Matuška [Fri, 10 May 2019 19:53:27 +0000 (21:53 +0200)] 
Merge pull request #1196 from antekone/rar5_verify_window_size

RAR5 reader: fix a potential SIGSEGV on 32-bit builds

6 years agoUnify define for _WIN32 in tests
Martin Matuska [Fri, 10 May 2019 09:43:00 +0000 (11:43 +0200)] 
Unify define for _WIN32 in tests

6 years agoRAR5 reader: set correct mode for readonly directories
Martin Matuska [Thu, 9 May 2019 21:46:22 +0000 (23:46 +0200)] 
RAR5 reader: set correct mode for readonly directories

Fix shadowed declaration in processing fflags

6 years agoRAR5 reader: use textual representation for entry file attributes
Martin Matuska [Thu, 9 May 2019 21:34:17 +0000 (23:34 +0200)] 
RAR5 reader: use textual representation for entry file attributes

Add test_read_format_rar5_fileattr

6 years agoExtend test_entry to test file flags on MacOS and Windows
Martin Matuska [Thu, 9 May 2019 20:15:46 +0000 (22:15 +0200)] 
Extend test_entry to test file flags on MacOS and Windows

6 years agoAdd support for Windows file attributes readonly, hidden and system
Martin Matuska [Wed, 8 May 2019 22:06:46 +0000 (00:06 +0200)] 
Add support for Windows file attributes readonly, hidden and system

6 years agoRAR5 reader: fix a potential SIGSEGV on 32-bit builds 1196/head
Grzegorz Antoniak [Thu, 9 May 2019 05:00:33 +0000 (07:00 +0200)] 
RAR5 reader: fix a potential SIGSEGV on 32-bit builds

The reader was causing a SIGSEGV when the file has been declaring a
specific dictionary size. Dictionary sizes above 0xFFFFFFFF bytes are
overflowing size_t type on 32-bit builds. In case the file has been
declaring dictionary size of 0x100000000 (so, UINT_MAX+1), the
window_size variable effectively contained value of 0. Later, the memory
allocation function was skipping actual allocation of 0 bytes, but still
tried to unpack the data.

This commit limits the dictionary window size buffer to 64MB, so it
always fits in a size_t variable, and disallows a zero dictionary size
for files in the header processing stage.

One unit test had to be modified after this change.

6 years agoRAR5 reader: verify that buffer is initialized in copy_string()
Martin Matuska [Tue, 7 May 2019 22:22:52 +0000 (00:22 +0200)] 
RAR5 reader: verify that buffer is initialized in copy_string()

Fixes broken test_read_format_rar5_invalid_dict_reference on OmniOS

6 years agoFix of MSZIP signature parsing
Alexander Chaikovsky [Sat, 20 Apr 2019 22:17:29 +0000 (01:17 +0300)] 
Fix of MSZIP signature parsing

Fixes #1174

6 years agoFix incompatibility introduced by merging PR #1192
Martin Matuska [Tue, 7 May 2019 13:10:13 +0000 (15:10 +0200)] 
Fix incompatibility introduced by merging PR #1192

Makes test_archive_write_set_format_filter_by_ext_tar_gz pass on OmniOS.

6 years agoFix test for pull request #1180
Martin Matuska [Tue, 7 May 2019 12:30:47 +0000 (14:30 +0200)] 
Fix test for pull request #1180

6 years agoMerge pull request #1180 from vapier/master
Martin Matuska [Tue, 7 May 2019 10:35:48 +0000 (12:35 +0200)] 
Merge pull request #1180 from vapier/master

zip: add support for Info-ZIP Unicode Path Extra Field

6 years agomtree reader: allow only printable ascii characters
Martin Matuska [Mon, 6 May 2019 23:16:12 +0000 (01:16 +0200)] 
mtree reader: allow only printable ascii characters

6 years agoMerge pull request #1191 from DerDakon/cmp0075
Martin Matuška [Mon, 6 May 2019 20:47:47 +0000 (22:47 +0200)] 
Merge pull request #1191 from DerDakon/cmp0075

CMake: fix more CMP0075 errors

6 years agoMerge pull request #1193 from DerDakon/rar-size
Martin Matuška [Mon, 6 May 2019 20:47:04 +0000 (22:47 +0200)] 
Merge pull request #1193 from DerDakon/rar-size

fix format string error when printing RAR5 VERSION field

6 years agofix format string error when printing RAR5 VERSION field 1193/head
Rolf Eike Beer [Sun, 5 May 2019 12:45:12 +0000 (14:45 +0200)] 
fix format string error when printing RAR5 VERSION field

Fixes: 4a94ef4eee112224ae19e05651caad28c7f04751
6 years agoarchive_read_support_format_rar5.c: style fixes
Martin Matuska [Mon, 6 May 2019 14:40:41 +0000 (16:40 +0200)] 
archive_read_support_format_rar5.c: style fixes

Wrap to 80 characters.
Use four spaces where appropriate.

6 years agoMerge pull request #1192 from DerDakon/gzip-sign
Martin Matuška [Mon, 6 May 2019 11:01:25 +0000 (13:01 +0200)] 
Merge pull request #1192 from DerDakon/gzip-sign

fix build with -Werror=sign-compare

6 years agoMerge pull request #1190 from antekone/rar5_ossfuzz_fixes_6
Martin Matuška [Mon, 6 May 2019 11:00:12 +0000 (13:00 +0200)] 
Merge pull request #1190 from antekone/rar5_ossfuzz_fixes_6

 RAR5 reader: don't try to unpack entries marked as directories

6 years agoMerge pull request #1188 from antekone/rar5_formatting_fixes
Martin Matuška [Mon, 6 May 2019 10:59:12 +0000 (12:59 +0200)] 
Merge pull request #1188 from antekone/rar5_formatting_fixes

Converted space indentation to tabs in RAR reader, ZIP reader tests

6 years agoRAR5 reader: don't try to unpack entries marked as directories 1190/head
Grzegorz Antoniak [Sun, 5 May 2019 06:16:03 +0000 (08:16 +0200)] 
RAR5 reader: don't try to unpack entries marked as directories

RAR5 structure contains two places where a file can be marked as a
directory. First place is inside the file_flags field in FILE and
SERVICE base blocks, and the second place is inside file_attributes
bitfield also in the same base blocks.

The first directory flag was used to decide if the reader should
allocate any memory for the dictionary buffer needed to unpack the
files. Because if the file is actually a directory, then there should be
nothing to unpack, so if a file was marked as a directory here, the
reader did not allocate any dictionary buffer.

The second directory flag was used to indicate what file attributes
should be passed to the caller. So this second directory flag was used
as an actual indicator what the caller should do during archive
unpacking: should it treat it as a directory, or should it treat it as a
file.

Because of this situation, it was possible to declare a file as a
directory in the file_flags field, but do not declare it as a directory
in the second field, also adding a compressed stream to the FILE/SERVICE
base block. This situation was leading to a condition where the reader
was trying to use unallocated/already freed memory (because it did not
allocate a new dictionary buffer due to the directory flag set in
file_flags).

This commit fixes it so that the reader will check if it tries to
decompress a FILE/SERVICE block that has been declared as a directory in
the file_flags field. If the check will evaluate to true, it will return
an ARCHIVE_FAILED code, because it's not a valid action to take, and
shouldn't exist in valid archives at all.

Also added a unit test for this issue.

This should fix OSSFuzz issue #14574.

This commit also has influenced some of the other unit tests, because it
turned out the sample files used in other tests also did have
inconsistent directory flags in the file_flags and file_attributes
fields. So, some assertions in affected test cases have been changed to
be more relaxed, but still functional.

6 years agofix build with -Werror=sign-compare 1192/head
Rolf Eike Beer [Sun, 5 May 2019 09:31:51 +0000 (11:31 +0200)] 
fix build with -Werror=sign-compare

Fixes: d91ef58185a2f7fa469a0391a6787b60e5b767c9
6 years agoCMake: fix more CMP0075 errors 1191/head
Rolf Eike Beer [Sun, 5 May 2019 09:07:20 +0000 (11:07 +0200)] 
CMake: fix more CMP0075 errors

Building with CMake 3.12 or newer would warn during configuration otherwise.

6 years agoMerge pull request #1189 from antekone/bug_memleak_test_read_format_raw
Martin Matuška [Sun, 5 May 2019 06:06:23 +0000 (08:06 +0200)] 
Merge pull request #1189 from antekone/bug_memleak_test_read_format_raw

Fixed memory leak in test_read_format_raw

6 years agoFixed memory leak in test_read_format_raw 1189/head
Grzegorz Antoniak [Sun, 5 May 2019 05:05:10 +0000 (07:05 +0200)] 
Fixed memory leak in test_read_format_raw

This commit fixes the memory leak introduced by accident in 0debf359.

6 years agoConverted space indentation to tabs in RAR reader, ZIP reader tests 1188/head
Grzegorz Antoniak [Sat, 4 May 2019 06:02:50 +0000 (08:02 +0200)] 
Converted space indentation to tabs in RAR reader, ZIP reader tests

Whole libarchive uses tab characters to indent scopes. RAR5 reader and
RAR5 reader tests were using space characters for indentation.
Additionally ZIP reader tests was using space indentation only in
specific places, but most of the file used tab character for indent.

This commit converts space indentation characters to tabs.

It does not change anything in logic.