]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
4 years agoLibarchive 3.4.2 v3.4.2
Martin Matuska [Tue, 11 Feb 2020 21:49:11 +0000 (22:49 +0100)] 
Libarchive 3.4.2

4 years agoAdd script to generate release files with Docker.
Martin Matuska [Tue, 11 Feb 2020 17:40:54 +0000 (18:40 +0100)] 
Add script to generate release files with Docker.

4 years agoUnlink before creating a hardlink on Windows
Martin Matuska [Tue, 11 Feb 2020 17:34:45 +0000 (18:34 +0100)] 
Unlink before creating a hardlink on Windows
when using ARCHIVE_EXTRACT_SAFE_WRITES.

Completes #1330 for Windows.

4 years agoMerge pull request #1330 from zoulasc/master
Martin Matuška [Tue, 11 Feb 2020 17:24:37 +0000 (18:24 +0100)] 
Merge pull request #1330 from zoulasc/master

Fix ARCHIVE_EXTRACT_SAFE_WRITES for existing symlinks

4 years agoJust like the hard link case, for symlinks we need to remove first 1330/head
zoulasc [Tue, 11 Feb 2020 00:43:32 +0000 (19:43 -0500)] 
Just like the hard link case, for symlinks we need to remove first
for ARCHIVE_EXTRACT_SAFE_WRITES.

4 years agoUpdate NEWS
Martin Matuska [Mon, 10 Feb 2020 13:46:15 +0000 (14:46 +0100)] 
Update NEWS

4 years agoRAR5 reader: use %zu to sprintf() size_t
Martin Matuska [Mon, 10 Feb 2020 13:26:17 +0000 (14:26 +0100)] 
RAR5 reader: use %zu to sprintf() size_t

4 years agoCI Windows: download zlib and bzip2 from cloned repositories
Martin Matuska [Sun, 9 Feb 2020 07:15:58 +0000 (08:15 +0100)] 
CI Windows: download zlib and bzip2 from cloned repositories

4 years agoCI: generate and publish build artifacts on GitHub actions
Martin Matuska [Sat, 8 Feb 2020 22:02:53 +0000 (23:02 +0100)] 
CI: generate and publish build artifacts on GitHub actions

Fixes #1313

4 years agoCI: build and use bzip2 on Windows from GiLab repository
Martin Matuska [Fri, 7 Feb 2020 13:50:37 +0000 (14:50 +0100)] 
CI: build and use bzip2 on Windows from GiLab repository

Use static versions of zlib and bzip2 on Windows.
Simplify ci.cmd for GitHub Actions.

4 years agoMerge pull request #1329 from bradking/string-append-wcs-overflow
Martin Matuška [Fri, 7 Feb 2020 13:16:58 +0000 (14:16 +0100)] 
Merge pull request #1329 from bradking/string-append-wcs-overflow

Fix possible heap-buffer-overflow in archive_string_append_from_wcs on Windows

4 years agoRAR5 reader: do not mutate a global variable
Martin Matuska [Thu, 6 Feb 2020 21:52:36 +0000 (22:52 +0100)] 
RAR5 reader: do not mutate a global variable

Read RAR5 signature with a function instead.
Fixes #1303

4 years agoCI: exit with error on failure in Visual Studio stages
Martin Matuska [Fri, 7 Feb 2020 09:45:15 +0000 (10:45 +0100)] 
CI: exit with error on failure in Visual Studio stages

4 years ago7z reader: support Delta filter with values 2-256
Martin Matuska [Thu, 6 Feb 2020 20:44:30 +0000 (21:44 +0100)] 
7z reader: support Delta filter with values 2-256

Fixes #987

4 years agoFix possible heap-buffer-overflow in archive_string_append_from_wcs on Windows 1329/head
Brad King [Thu, 6 Feb 2020 19:28:02 +0000 (14:28 -0500)] 
Fix possible heap-buffer-overflow in archive_string_append_from_wcs on Windows

Fix `archive_string_append_from_wcs_in_codepage` to account for the
already-used portion of the buffer when computing the size of the
remaining buffer for `WideCharToMultiByte` output.

4 years agoMerge pull request #1326 from antekone/rar5_ossfuzz_20459
Martin Matuška [Sun, 2 Feb 2020 21:48:34 +0000 (22:48 +0100)] 
Merge pull request #1326 from antekone/rar5_ossfuzz_20459

RAR5 reader: reject files that declare invalid header flags

4 years agoRAR5 reader: reject files that declare invalid header flags 1326/head
Grzegorz Antoniak [Sun, 2 Feb 2020 07:04:41 +0000 (08:04 +0100)] 
RAR5 reader: reject files that declare invalid header flags

One of the fields in RAR5's base block structure is the size of the
header. Some invalid files declare a 0 header size setting, which can
confuse the unpacker. Minimum header size for RAR5 base blocks is 7
bytes (4 bytes for CRC, and 3 bytes for the rest), so block size of 0
bytes should be rejected at header parsing stage.

The fix adds an error condition if header size of 0 bytes is detected.
In this case, the unpacker will not attempt to unpack the file, as the
header is corrupted.

The commit also adds OSSFuzz #20459 sample to test further regressions
in this area.

4 years agoMerge pull request #1324 from bradking/solaris-11.4
Martin Matuška [Sat, 1 Feb 2020 18:38:16 +0000 (19:38 +0100)] 
Merge pull request #1324 from bradking/solaris-11.4

libarchive: Fix detection of 'major' on Solaris 11.4

4 years agoFix use after free in ISO9660 and XAR writer
Martin Matuska [Fri, 31 Jan 2020 23:58:03 +0000 (00:58 +0100)] 
Fix use after free in ISO9660 and XAR writer

Remove rbtree nodes before freeing them.
For better code readability import new rbtree macros from NetBSD.

Fixes #1325

4 years agoUpdate filter and format options in manual pages.
Martin Matuska [Thu, 30 Jan 2020 23:30:34 +0000 (00:30 +0100)] 
Update filter and format options in manual pages.

The list of format and filter options in bsdtar(1) is incomplete.
Add reference to manual pages archive_write_set_options(3) and
archive_read_set_options(3) for a complete list of supported options.

Fixes #1323

4 years agomtree reader: initialize checkfs with 0
Martin Matuska [Thu, 30 Jan 2020 23:29:35 +0000 (00:29 +0100)] 
mtree reader: initialize checkfs with 0

4 years agolibarchive: Fix detection of 'major' on Solaris 11.4 1324/head
Brad King [Thu, 30 Jan 2020 14:49:22 +0000 (09:49 -0500)] 
libarchive: Fix detection of 'major' on Solaris 11.4

In `archive_pack_dev.c` there is code checking the `HAVE_MAJOR` macro,
but it is not computed.  Port the equivalent logic from
`archive_entry.c` to define the macro.

4 years agoCmake MSVC: replace warning C4061 with C4062
Martin Matuska [Mon, 27 Jan 2020 23:25:53 +0000 (00:25 +0100)] 
Cmake MSVC: replace warning C4061 with C4062

Fixes #1322

4 years agotest_write_format_xar: add "none" options to test
Martin Matuska [Sun, 26 Jan 2020 00:20:36 +0000 (01:20 +0100)] 
test_write_format_xar: add "none" options to test

4 years agoPAX writer: fix return-on-error memory leaks in archive_write_pax_header()
Martin Matuska [Sun, 26 Jan 2020 00:01:25 +0000 (01:01 +0100)] 
PAX writer: fix return-on-error memory leaks in archive_write_pax_header()

4 years agoPAX writer: fix entry uname or gname longer than 32 characters
Martin Matuska [Sat, 25 Jan 2020 23:35:50 +0000 (00:35 +0100)] 
PAX writer: fix entry uname or gname longer than 32 characters

Fixes #1319

4 years agoUnify unsupported entry file type error message in writer
Martin Matuska [Sat, 25 Jan 2020 13:26:59 +0000 (14:26 +0100)] 
Unify unsupported entry file type error message in writer

Closes #1320

4 years agoXAR writer: fix compression output buffer handling
Martin Matuska [Thu, 23 Jan 2020 15:13:19 +0000 (16:13 +0100)] 
XAR writer: fix compression output buffer handling

Add "none" as acceptable value to xar:checksum and xar:toc-checksum
Document XAR options in bsdtar(1)

Fixes #1317

4 years agoCI: make mingw32-make verbose
Martin Matuska [Wed, 22 Jan 2020 22:30:32 +0000 (23:30 +0100)] 
CI: make mingw32-make verbose

4 years agoAdd printf attributes to the printflike functions used in tests and fix
zoulasc [Tue, 21 Jan 2020 18:34:18 +0000 (13:34 -0500)] 
Add printf attributes to the printflike functions used in tests and fix
the format errors.

Closes #1318

4 years agoRAR5 reader: refactored parse_tables() a little bit
Grzegorz Antoniak [Wed, 1 Jan 2020 06:29:34 +0000 (07:29 +0100)] 
RAR5 reader: refactored parse_tables() a little bit

Some if/continue constructs could be changed to if/elseif/else blocks.
This allows elimination of superfluous 'continue' directives.

Closes #1280

4 years agoUpdate archive_read_support_format_rar5.c
MonkeybreadSoftware [Fri, 22 Nov 2019 11:17:37 +0000 (12:17 +0100)] 
Update archive_read_support_format_rar5.c

A patch to make this compile in older Visual Studio.
Moving variable declaration up for C89 standard.

4 years agoCI: raise error if MinGW tests fail
Martin Matuska [Wed, 22 Jan 2020 16:35:34 +0000 (17:35 +0100)] 
CI: raise error if MinGW tests fail

4 years agoFix error when overwriting files on Windows
Martin Matuska [Wed, 22 Jan 2020 16:13:43 +0000 (17:13 +0100)] 
Fix error when overwriting files on Windows

Introduced in 467d193dd61ca7669a5ba8d38e09836babf64e58

4 years agoFix 7zip_packinfo_digests test when LZMA is not supported
Martin Matuska [Wed, 22 Jan 2020 15:07:12 +0000 (16:07 +0100)] 
Fix 7zip_packinfo_digests test when LZMA is not supported

4 years agocontrib/archivetest: fix compilation under MinGW
Martin Matuska [Wed, 22 Jan 2020 15:06:25 +0000 (16:06 +0100)] 
contrib/archivetest: fix compilation under MinGW

4 years ago7zip reader tests: fixes when LZMA is unsupported
Martin Matuska [Wed, 22 Jan 2020 14:28:08 +0000 (15:28 +0100)] 
7zip reader tests: fixes when LZMA is unsupported

4 years agobsdtar.1: --exclude-vcs sort version control systems and add git
Martin Matuska [Mon, 20 Jan 2020 14:59:25 +0000 (15:59 +0100)] 
bsdtar.1: --exclude-vcs sort version control systems and add git

Fixes #1314

4 years agoAdd test_option_safe_writes to tar tests
Martin Matuska [Mon, 20 Jan 2020 13:23:08 +0000 (14:23 +0100)] 
Add test_option_safe_writes to tar tests

4 years agoImplement ARCHIVE_EXTRACT_SAFE_WRITES on Windows
Martin Matuska [Mon, 20 Jan 2020 10:41:18 +0000 (11:41 +0100)] 
Implement ARCHIVE_EXTRACT_SAFE_WRITES on Windows

As Windows does not support atomic rename/_wrename
we have to unlink the file right before calling _wrename
leaving a short unsafe window where a different file with the
same name can be created and make the rename operation fail.

4 years agoIntroduce archive_write_disk(3) flag ARCHIVE_EXTRACT_SAFE_WRITES
zoulasc [Mon, 20 Jan 2020 12:20:42 +0000 (13:20 +0100)] 
Introduce archive_write_disk(3) flag ARCHIVE_EXTRACT_SAFE_WRITES

This flag changes the way that regular files are extracted:

Instead of removing existing files first and re-creating them in
order to replace their contents, a temporary file is created and
when writing to the temporary file is completed, the file is
rename(2)d to the final destination name.

This has the effect of presenting a consistent view of the file to
the system (either the file with the new contents or the file with
the old contents). Removing and overwriting the file has the
undesired side effect that the the system can either not see the
file at all (from the time it is being removed till the time it is
being re-created), or worse it can see partial file contents. This
is problematic when extracting system files (for example shared
libraries).

If the existing file that is going to be overwritten is a hard link,
for now we unlink it before calling rename(2). This can be done
correctly by creating a hardlink to a tmpnam(3) generated file
and then use rename(2), but that is fairly intrusive and requires
refactoring.

Fixes #1289

4 years agoRAR5 reader: fix unsafe sign check of a bitwise operation.
Martin Matuska [Sat, 18 Jan 2020 00:18:43 +0000 (01:18 +0100)] 
RAR5 reader: fix unsafe sign check of a bitwise operation.

This has no but code correctness effect as cdeque_init() is static
and max_capacity_power_of_2 in our code is always 8192.

Found by LGTM.com code analysis

4 years agoarchive_read.c: remove unnecessary comparsion (iindex is unsigned int)
Martin Matuska [Thu, 16 Jan 2020 23:31:07 +0000 (00:31 +0100)] 
archive_read.c: remove unnecessary comparsion (iindex is unsigned int)

Found by LGTM.com code analysis

4 years agoMerge pull request #1316 from zoulasc/tests
Martin Matuška [Thu, 16 Jan 2020 21:10:04 +0000 (22:10 +0100)] 
Merge pull request #1316 from zoulasc/tests

Various test improvements

4 years agoANSI-C prototypes 1316/head
zoulasc [Thu, 16 Jan 2020 20:34:32 +0000 (15:34 -0500)] 
ANSI-C prototypes

4 years agoAdd missing const
zoulasc [Thu, 16 Jan 2020 20:34:16 +0000 (15:34 -0500)] 
Add missing const

4 years agoAdd missing const
zoulasc [Thu, 16 Jan 2020 20:33:58 +0000 (15:33 -0500)] 
Add missing const

4 years agoAdd missing const
zoulasc [Thu, 16 Jan 2020 20:33:39 +0000 (15:33 -0500)] 
Add missing const

4 years ago- Add the NetBSD-specific config.h
zoulasc [Thu, 16 Jan 2020 20:29:57 +0000 (15:29 -0500)] 
- Add the NetBSD-specific config.h
- Use --help instead of -V when -V exits with non-zero code
- Double the string size to prevent truncation

4 years agoRAR5 and WARC readers: move unnecessary comparsion into a comment
Martin Matuska [Thu, 16 Jan 2020 15:13:40 +0000 (16:13 +0100)] 
RAR5 and WARC readers: move unnecessary comparsion into a comment
RAR5 reader: comment out unreachable code

Found by LGTM.com code analysis

4 years agoarchive_ppmd7.c: avoid possible integer overflow (security)
Martin Matuska [Tue, 14 Jan 2020 15:35:31 +0000 (16:35 +0100)] 
archive_ppmd7.c: avoid possible integer overflow (security)

Found by LGTM.com code analysis

4 years agoMultiple code fixes and optimizations
Martin Matuska [Tue, 14 Jan 2020 13:40:11 +0000 (14:40 +0100)] 
Multiple code fixes and optimizations

archive_read_support_format_rar5.c:
  Bitfield int -> signed int

Archive_write_set_format_iso9660.c:
  Bitfield int -> signed int

archive_write_set_format_xar.c:
  Bitfield int -> signed int

archive_write_set_format_7zip.c:
  Bitfield int -> signed int

archive_read_support_format_xar.c
  Remove useless comparsion

archive_read_support_format_rar.c:
  Fix invalid nested loop break.
  Comment out dead code sections.
  Simplify size comparsions of lensymbol and offsymbol.

archive_read_support_filter_uu.c:
  Remove useless comparsions

archive_read_disk_posix.c:
  Remove useless do-while-zero

Found by LGTM.com code analysis

4 years agoWindows: use _localtime64_s and _gmtime64_s where appropriate
Martin Matuska [Mon, 13 Jan 2020 13:23:00 +0000 (14:23 +0100)] 
Windows: use _localtime64_s and _gmtime64_s where appropriate

4 years agoUnify header style, header guard comes first
Martin Matuska [Mon, 13 Jan 2020 12:28:26 +0000 (13:28 +0100)] 
Unify header style, header guard comes first

Found by LGTM.com code analysis

4 years agoUse localtime_r and gmtime_r if supported
Martin Matuska [Mon, 13 Jan 2020 11:37:32 +0000 (12:37 +0100)] 
Use localtime_r and gmtime_r if supported

Found by LGTM.com code analysis

4 years agoFix erroneous use of archive_string_empty() macro
Martin Matuska [Sun, 12 Jan 2020 07:52:33 +0000 (08:52 +0100)] 
Fix erroneous use of archive_string_empty() macro

Found by LGTM.com code analysis

4 years agoLHA reader UTF16: dirSep must match machine endianess
Martin Matuska [Thu, 9 Jan 2020 11:36:59 +0000 (12:36 +0100)] 
LHA reader UTF16: dirSep must match machine endianess

4 years agoLHA reader UTF-16: Encode directory separator with archive_le16enc()
Martin Matuska [Thu, 9 Jan 2020 09:51:34 +0000 (10:51 +0100)] 
LHA reader UTF-16: Encode directory separator with archive_le16enc()

Wrap to 80 characters.
Fixes #1307

4 years agoMerge pull request #1308 from Claybird/fix_lha_endian
Martin Matuška [Tue, 7 Jan 2020 20:20:23 +0000 (21:20 +0100)] 
Merge pull request #1308 from Claybird/fix_lha_endian

Fixed endian problem in lha UTF-16 encoding.
Fixes #1307

4 years agoFixed endian problem in lha UTF-16 encoding. 1308/head
Claybird [Tue, 7 Jan 2020 13:07:52 +0000 (22:07 +0900)] 
Fixed endian problem in lha UTF-16 encoding.

A patch to fix #1307

4 years agoRedo fix for #1302 in a way that archive_write_client_open()
Martin Matuska [Mon, 6 Jan 2020 02:08:17 +0000 (03:08 +0100)] 
Redo fix for #1302 in a way that archive_write_client_open()
correctly frees its allocations in an error case.

Reverts 5e270715b51d199467195b56f77e21cb8bb1d642

4 years agoMinor style newline consistency fixes
Martin Matuska [Sun, 5 Jan 2020 02:09:34 +0000 (03:09 +0100)] 
Minor style newline consistency fixes

4 years agoImplement archive_write_client_free()
Martin Matuska [Fri, 3 Jan 2020 02:47:19 +0000 (03:47 +0100)] 
Implement archive_write_client_free()

Plugs memory leak of test_open_failure
Fixes #1302

4 years agoAdd mbed TLS as optional crypto provider
Martin Matuska [Thu, 2 Jan 2020 23:24:39 +0000 (00:24 +0100)] 
Add mbed TLS as optional crypto provider

Make Nettle optional and OpenSSL default
Fixes #1301

4 years agoLibarchive 3.4.2dev
Martin Matuska [Mon, 30 Dec 2019 01:16:19 +0000 (02:16 +0100)] 
Libarchive 3.4.2dev

4 years agoLibarchive 3.4.1 v3.4.1
Martin Matuska [Mon, 30 Dec 2019 01:12:32 +0000 (02:12 +0100)] 
Libarchive 3.4.1

4 years agoFix possible off-by-one when dealing with readlink(2)
Pawel Jakub Dawidek [Sun, 22 Dec 2019 00:10:38 +0000 (01:10 +0100)] 
Fix possible off-by-one when dealing with readlink(2)

readlink(2) and readlinkat(2) don't append a null byte to the given buffer.

4 years agoFix a possible heap-buffer-overflow in archive_string_append_from_wcs()
Martin Matuska [Sat, 28 Dec 2019 21:58:08 +0000 (22:58 +0100)] 
Fix a possible heap-buffer-overflow in archive_string_append_from_wcs()

When we grow the archive_string buffer, we have to make sure it fits
at least one maximum-sized multibyte character in the current locale
and the null character.

Fixes #1298

4 years agoMerge pull request #1297 from antekone/bug/GH-1257
Martin Matuška [Sat, 28 Dec 2019 15:31:23 +0000 (16:31 +0100)] 
Merge pull request #1297 from antekone/bug/GH-1257

ZIP reader: support LZMA_STREAM_END marker in 'lzma alone' files

4 years agoZIP reader: support LZMA_STREAM_END marker in 'lzma alone' files 1297/head
Grzegorz Antoniak [Mon, 23 Dec 2019 07:20:28 +0000 (08:20 +0100)] 
ZIP reader: support LZMA_STREAM_END marker in 'lzma alone' files

It appears that ZIPX files with type 14 stream ('lzma alone') can
contain LZMA_STREAM_END markers at the end of the stream. The ZIP reader
was displaying an "unknown error 1" status after encountering such
marker.

The fix handles such case, and the reader doesn't return error status
anymore. Thus it should be possible to unpack files that contain the
LZMA_STREAM_END marker at the end of the stream.

Fixes #1257

4 years agoAdd test for reading 7z archives with Digests in PackInfo
Martin Matuska [Sat, 21 Dec 2019 22:10:37 +0000 (23:10 +0100)] 
Add test for reading 7z archives with Digests in PackInfo

Fixes #1295

4 years ago7z: PackInfo Digests are prefixed by kCRC, not kSize
cielavenir [Thu, 19 Dec 2019 04:10:04 +0000 (13:10 +0900)] 
7z: PackInfo Digests are prefixed by kCRC, not kSize

4 years agoMerge pull request #1296 from antekone/rar5_ossfuzz_19509
Martin Matuška [Sat, 21 Dec 2019 21:19:29 +0000 (22:19 +0100)] 
Merge pull request #1296 from antekone/rar5_ossfuzz_19509

RAR5 reader: verify window size for multivolume archives

4 years agoRAR5 reader: verify window size for multivolume archives 1296/head
Grzegorz Antoniak [Wed, 18 Dec 2019 18:28:12 +0000 (19:28 +0100)] 
RAR5 reader: verify window size for multivolume archives

RAR5 archives can contain files that span across multiple .rar files. If the
archive contains a big file that doesn't fit to first .rar file, then this file
is continued in another .rar file.

In this case, the RAR compressor first emits the FILE base block for this big
file in the first .rar file. Then, it finishes first .rar file, and creates the
new .rar file. In this new file, it emits the continuation FILE block that
marks start of the continuation data for the rest of the huge file.

The problem was that the RAR5 reader didn't ignore the window size declaration
when parsing through the continuation FILE base block. The malicious file could
declare a different window size inside the continuation base block than was
declared in the primary FILE base block in the previous volume. The window size
from continuation block was applied, but the actual window buffer was not
reallocated. This resulted in a potential SIGSEGV error, since bounary checks
for accessing the window buffer were working incorrectly (the window size
variable didn't match the actual window buffer size).

The commit fixes the issue by ignoring the window size declaration in the
continuation FILE base block when switching volumes.

The commit also contains a test case and OSSFuzz sample #19509.

4 years agoMerge pull request #1288 from mmatuska/configurable_xattr_headers
Martin Matuška [Sun, 15 Dec 2019 00:45:12 +0000 (01:45 +0100)] 
Merge pull request #1288 from mmatuska/configurable_xattr_headers

Add the "xattrhdr" option to pax write options.

4 years agoCI: upgrade FreeBSD Cirrus CI images to 12.1 and 11.3
Martin Matuska [Sat, 14 Dec 2019 23:20:51 +0000 (00:20 +0100)] 
CI: upgrade FreeBSD Cirrus CI images to 12.1 and 11.3

4 years agoLHA reader: plug two memory leaks on error
Martin Matuska [Sat, 14 Dec 2019 23:05:40 +0000 (00:05 +0100)] 
LHA reader: plug two memory leaks on error

Reported by: OSS-Fuzz issue 19360, 19362

4 years agoAdd the "xattrhdr" option to pax write options. 1288/head
Martin Matuska [Tue, 3 Dec 2019 00:09:42 +0000 (01:09 +0100)] 
Add the "xattrhdr" option to pax write options.

This allows us to control whether "SCHILY.xattr", "LIBARCHIVE.xattr" or
both headers (default) are written when storing extended attributes.

Document "hdrcharset" option for pax.

4 years agoImplement private state logic for write filters 1287/head
Martin Matuska [Fri, 6 Dec 2019 10:25:19 +0000 (11:25 +0100)] 
Implement private state logic for write filters

This ensures that filters may be opened and closed only once and
__archive_write_filter() may be called only on an open filter.

Refactor filter open code and move logic to archive_write.c

Fixes #351

4 years agoRemove remnants of archive_entry_acl_next_w
Joerg Sonnenberger [Sat, 30 Nov 2019 04:15:27 +0000 (05:15 +0100)] 
Remove remnants of archive_entry_acl_next_w

4 years agoRemove unused variables
Joerg Sonnenberger [Wed, 27 Nov 2019 21:15:11 +0000 (22:15 +0100)] 
Remove unused variables

4 years agoRemove unused variable
Joerg Sonnenberger [Wed, 27 Nov 2019 21:13:21 +0000 (22:13 +0100)] 
Remove unused variable

4 years agoWhen the initial archive open for write fails, explicitly free filters.
Joerg Sonnenberger [Sat, 19 Oct 2019 15:15:05 +0000 (17:15 +0200)] 
When the initial archive open for write fails, explicitly free filters.

This provides a defense-in-depth against programming errors due to the
partial state. Based on a report from Airbus Security - Vulnerability
Management.

4 years agoRefactor archive_write_close_filter logic
Joerg Sonnenberger [Sat, 19 Oct 2019 15:09:11 +0000 (17:09 +0200)] 
Refactor archive_write_close_filter logic

4 years agoarchive_write_filter_compress: free state in free handler
Joerg Sonnenberger [Sat, 19 Oct 2019 14:59:51 +0000 (16:59 +0200)] 
archive_write_filter_compress: free state in free handler

4 years agoLHA reader: ensure that UTF-16 input always has a multiple of 2 bytes
Martin Matuska [Tue, 26 Nov 2019 22:32:31 +0000 (23:32 +0100)] 
LHA reader: ensure that UTF-16 input always has a multiple of 2 bytes

Fixes #1284

4 years agoMerge pull request #1282 from kwojcicki/master
Tim Kientzle [Mon, 25 Nov 2019 22:22:22 +0000 (14:22 -0800)] 
Merge pull request #1282 from kwojcicki/master

Fixing resource cleanup in minitar

4 years agoFixing resource cleanup in minitar 1282/head
Krystian Wojcicki [Sat, 23 Nov 2019 03:42:43 +0000 (22:42 -0500)] 
Fixing resource cleanup in minitar

4 years agoCI: remove Fedora 30 distcheck at Cirrus CI
Martin Matuska [Thu, 21 Nov 2019 22:33:40 +0000 (23:33 +0100)] 
CI: remove Fedora 30 distcheck at Cirrus CI

4 years agoBugfix and optimize archive_wstring_append_from_mbs()
Martin Matuska [Thu, 21 Nov 2019 02:08:40 +0000 (03:08 +0100)] 
Bugfix and optimize archive_wstring_append_from_mbs()

The cal to mbrtowc() or mbtowc() should read up to mbs_length
bytes and not wcs_length. This avoids out-of-bounds reads.

mbrtowc() and mbtowc() return (size_t)-1 wit errno EILSEQ when
they encounter an invalid multibyte character and (size_t)-2 when
they they encounter an incomplete multibyte character. As we return
failure and all our callers error out it makes no sense to continue
parsing mbs.

As we allocate `len` wchars at the beginning and each wchar has
at least one byte, there will never be need to grow the buffer,
so the code can be left out. On the other hand, we are always
allocatng more memory than we need.

As long as wcs_length == mbs_length == len we can omit wcs_length.
We keep the old code commented if we decide to save memory and
use autoexpanding wcs_length in the future.

Fixes #1276

4 years agoHave "make dist" create .tar.gz, .tar.xz and .zip distribution files
Martin Matuska [Wed, 20 Nov 2019 00:42:22 +0000 (01:42 +0100)] 
Have "make dist" create .tar.gz, .tar.xz and .zip distribution files

Fixes #1277

4 years agoWhen opening directories, use O_EXEC flag only on FreeBSD
Martin Matuska [Tue, 19 Nov 2019 15:50:27 +0000 (16:50 +0100)] 
When opening directories, use O_EXEC flag only on FreeBSD

Fixes #1279

4 years agoCI: add distcheck and MacOS build to github actions
Martin Matuska [Mon, 18 Nov 2019 07:12:58 +0000 (08:12 +0100)] 
CI: add distcheck and MacOS build to github actions

4 years agoCI: move Windows MinGW and MSVC builds to GitHub Actions
Martin Matuska [Mon, 18 Nov 2019 01:11:03 +0000 (02:11 +0100)] 
CI: move Windows MinGW and MSVC builds to GitHub Actions

4 years agotest_open_fd: skip error test on GitHub Actions
Martin Matuska [Sun, 17 Nov 2019 23:11:37 +0000 (00:11 +0100)] 
test_open_fd: skip error test on GitHub Actions

4 years agotest_read_format_lha_filename_utf16.c: pass copyright with permission
Martin Matuska [Sun, 17 Nov 2019 23:00:54 +0000 (00:00 +0100)] 
test_read_format_lha_filename_utf16.c: pass copyright with permission

4 years agotest_read_format_lha_filename_utf16.c: add missing condition
Martin Matuska [Sun, 17 Nov 2019 21:57:24 +0000 (22:57 +0100)] 
test_read_format_lha_filename_utf16.c: add missing condition

4 years agoAdd missing testfile to Makefile.am
Martin Matuska [Sun, 17 Nov 2019 21:32:55 +0000 (22:32 +0100)] 
Add missing testfile to Makefile.am

4 years agoMerge pull request #1263 from Claybird/add_unicode_support_on_lha
Martin Matuška [Sun, 17 Nov 2019 21:09:11 +0000 (22:09 +0100)] 
Merge pull request #1263 from Claybird/add_unicode_support_on_lha

Adds UNICODE filename support for reading lha/lzh format

4 years agoFixed bugs in cases that dirname and fname have different codepages. 1263/head
Claybird [Thu, 7 Nov 2019 14:34:29 +0000 (23:34 +0900)] 
Fixed bugs in cases that dirname and fname have different codepages.