]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
6 years agoFix find lib lzma 1135/head
Ichiro [Tue, 5 Feb 2019 17:14:09 +0000 (02:14 +0900)] 
Fix find lib lzma

6 years agoMerge pull request #1125 from antekone/bug/GH-1119
Martin Matuška [Wed, 30 Jan 2019 23:27:41 +0000 (00:27 +0100)] 
Merge pull request #1125 from antekone/bug/GH-1119

RAR5 reader: fix an invalid read and a memory leak

6 years agoRemove test_compat_pax_libarchive_2x
Martin Matuska [Wed, 30 Jan 2019 16:43:50 +0000 (17:43 +0100)] 
Remove test_compat_pax_libarchive_2x

The is determined for FreeBSD only and it doesn't work since 2015.
There is no significant need to keep this functionality, it may be
deprecated.

6 years agoReorganize CI build scripts
Martin Matuska [Wed, 30 Jan 2019 15:56:37 +0000 (16:56 +0100)] 
Reorganize CI build scripts

6 years agoRemove Travis CI testing
Martin Matuska [Wed, 30 Jan 2019 15:42:38 +0000 (16:42 +0100)] 
Remove Travis CI testing

6 years agoCI build: allow BS as a shortcut for BUILD_SYSTEM variable
Martin Matuska [Tue, 22 Jan 2019 00:50:16 +0000 (01:50 +0100)] 
CI build: allow BS as a shortcut for BUILD_SYSTEM variable

6 years agoCirrus CI: add Fedora 29 container test
Martin Matuska [Sun, 20 Jan 2019 23:12:28 +0000 (00:12 +0100)] 
Cirrus CI: add Fedora 29 container test

6 years agoMerge pull request #1124 from mgorny/zstd
Martin Matuška [Tue, 22 Jan 2019 23:07:00 +0000 (00:07 +0100)] 
Merge pull request #1124 from mgorny/zstd

cmake: Add ENABLE_ZSTD option

6 years agocmake: Add ENABLE_ZSTD option 1124/head
Michał Górny [Tue, 22 Jan 2019 06:52:11 +0000 (07:52 +0100)] 
cmake: Add ENABLE_ZSTD option

6 years agoMerge pull request #1121 from kulikjak/fix_mkdev
Martin Matuška [Sun, 20 Jan 2019 10:32:17 +0000 (11:32 +0100)] 
Merge pull request #1121 from kulikjak/fix_mkdev

Add missing header file include

6 years agoMerge pull request #1110 from antekone/zipx_support_work_3
Martin Matuška [Sun, 20 Jan 2019 10:09:26 +0000 (11:09 +0100)] 
Merge pull request #1110 from antekone/zipx_support_work_3

ZIP reader: added support for XZ, LZMA, PPMD8 and BZIP2 decompression

6 years agoImprove cirrus build
Martin Matuska [Sun, 20 Jan 2019 01:10:53 +0000 (02:10 +0100)] 
Improve cirrus build

6 years agoMerge pull request #1120 from daxtens/fixes2
Martin Matuška [Sun, 20 Jan 2019 00:47:56 +0000 (01:47 +0100)] 
Merge pull request #1120 from daxtens/fixes2

Fix a 7zip crash and a ISO9660 infinite loop

6 years agoMerge pull request #1116 from GeraldNDA/GeraldNDA-support-64bit-ar
Martin Matuška [Sun, 20 Jan 2019 00:22:13 +0000 (01:22 +0100)] 
Merge pull request #1116 from GeraldNDA/GeraldNDA-support-64bit-ar

Add support for the 64-bit ar format

6 years agoRAR5 reader: Removed a memory leak in process_head_file 1125/head
Grzegorz Antoniak [Fri, 18 Jan 2019 06:24:17 +0000 (07:24 +0100)] 
RAR5 reader: Removed a memory leak in process_head_file

The process_head_file function was using memset() to clear the
archive_entry structure. The problem was that this structure could
contain pointers to allocated blocks of memory, and removing those
pointers with memset() resulted in a memory leak.

Switching it in favor of archive_entry_clear() effectively clears the
structure, but also releases any allocated memory blocks. This removes
the memory leak.

The commit also changes the way a temporary archive_entry instance is
being created when skipping a base block after block merge; instead of
directly creating a new instance on the stack, a constructor function
archive_entry_new() is used to ensure the new archive_entry instance is
not in an inconsistent state. This is needed because the fix described
in the first half of this commit message depends on the archive_entry
instance being in a consistent state due to the call of the
archive_entry_clear() function.

6 years agoRAR5 reader: Fixed a read from invalid memory block
Grzegorz Antoniak [Fri, 18 Jan 2019 05:17:19 +0000 (06:17 +0100)] 
RAR5 reader: Fixed a read from invalid memory block

In multi-file RAR5 archives, if a block spans from one file to another,
the RAR5 reader merges both blocks into one, and feeds this merged block
to the decompressor function. The problem is that the block merge
function allocates the exact number of bytes for this block. This is
problematic because when trying to read the last byte from this new
block with bit reader functions, the bit reader functions will reference
few additional bytes right after the byte the caller is trying to read,
resulting in an out of bounds read.

The commit increases the allocation size for new merged block. This
ensures that bit reader functions will never perform any out of bounds
reads. Additional space is zeroed out to prevent errors from
instrumentation tools like ASan or Valgrind.

Fixes #1119

6 years agoAdd missing header file include 1121/head
Jakub Kulík [Wed, 16 Jan 2019 16:19:48 +0000 (17:19 +0100)] 
Add missing header file include

6 years ago7zip: fix crash when parsing certain archives 1120/head
Daniel Axtens [Tue, 1 Jan 2019 05:01:40 +0000 (16:01 +1100)] 
7zip: fix crash when parsing certain archives

Fuzzing with CRCs disabled revealed that a call to get_uncompressed_data()
would sometimes fail to return at least 'minimum' bytes. This can cause
the crc32() invocation in header_bytes to read off into invalid memory.

A specially crafted archive can use this to cause a crash.

An ASAN trace is below, but ASAN is not required - an uninstrumented
binary will also crash.

==7719==ERROR: AddressSanitizer: SEGV on unknown address 0x631000040000 (pc 0x7fbdb3b3ec1d bp 0x7ffe77a51310 sp 0x7ffe77a51150 T0)
==7719==The signal is caused by a READ memory access.
    #0 0x7fbdb3b3ec1c in crc32_z (/lib/x86_64-linux-gnu/libz.so.1+0x2c1c)
    #1 0x84f5eb in header_bytes (/tmp/libarchive/bsdtar+0x84f5eb)
    #2 0x856156 in read_Header (/tmp/libarchive/bsdtar+0x856156)
    #3 0x84e134 in slurp_central_directory (/tmp/libarchive/bsdtar+0x84e134)
    #4 0x849690 in archive_read_format_7zip_read_header (/tmp/libarchive/bsdtar+0x849690)
    #5 0x5713b7 in _archive_read_next_header2 (/tmp/libarchive/bsdtar+0x5713b7)
    #6 0x570e63 in _archive_read_next_header (/tmp/libarchive/bsdtar+0x570e63)
    #7 0x6f08bd in archive_read_next_header (/tmp/libarchive/bsdtar+0x6f08bd)
    #8 0x52373f in read_archive (/tmp/libarchive/bsdtar+0x52373f)
    #9 0x5257be in tar_mode_x (/tmp/libarchive/bsdtar+0x5257be)
    #10 0x51daeb in main (/tmp/libarchive/bsdtar+0x51daeb)
    #11 0x7fbdb27cab96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
    #12 0x41dd09 in _start (/tmp/libarchive/bsdtar+0x41dd09)

This was primarly done with afl and FairFuzz. Some early corpus entries
may have been generated by qsym.

6 years agoiso9660: Fail when expected Rockridge extensions is missing
Daniel Axtens [Tue, 1 Jan 2019 06:10:49 +0000 (17:10 +1100)] 
iso9660: Fail when expected Rockridge extensions is missing

A corrupted or malicious ISO9660 image can cause read_CE() to loop
forever.

read_CE() calls parse_rockridge(), expecting a Rockridge extension
to be read. However, parse_rockridge() is structured as a while
loop starting with a sanity check, and if the sanity check fails
before the loop has run, the function returns ARCHIVE_OK without
advancing the position in the file. This causes read_CE() to retry
indefinitely.

Make parse_rockridge() return ARCHIVE_WARN if it didn't read an
extension. As someone with no real knowledge of the format, this
seems more apt than ARCHIVE_FATAL, but both the call-sites escalate
it to a fatal error immediately anyway.

Found with a combination of AFL, afl-rb (FairFuzz) and qsym.

6 years agoMove Cirrus CI commands to a separate script
Martin Matuska [Mon, 14 Jan 2019 15:11:07 +0000 (16:11 +0100)] 
Move Cirrus CI commands to a separate script
Test FreeBSD POSIX.1e and NFSv4 ACLs on Cirrus CI

6 years agoSkip test_compat_pax_libarchive_2x on FreeBSD for now.
Martin Matuska [Mon, 14 Jan 2019 14:59:53 +0000 (15:59 +0100)] 
Skip test_compat_pax_libarchive_2x on FreeBSD for now.
It is reportedly broken on all recent releases since 2015.

6 years agobuild/ci_build.sh: print failed test logs to stdout
Martin Matuska [Mon, 14 Jan 2019 14:28:27 +0000 (15:28 +0100)] 
build/ci_build.sh: print failed test logs to stdout

6 years agoAdd expat, libxml2, liblz4 and zstd to Cirrus CI FreeBSD build
Martin Matuska [Sun, 13 Jan 2019 00:45:48 +0000 (01:45 +0100)] 
Add expat, libxml2, liblz4 and zstd to Cirrus CI FreeBSD build

6 years agoMerge pull request #1117 from lwhsu/cirrus-ci
Martin Matuška [Sun, 13 Jan 2019 00:10:08 +0000 (01:10 +0100)] 
Merge pull request #1117 from lwhsu/cirrus-ci

Add Cirrus-CI config for FreeBSD builds

6 years agoAdd Cirrus-CI config for FreeBSD builds 1117/head
Li-Wen Hsu [Wed, 19 Dec 2018 04:24:26 +0000 (12:24 +0800)] 
Add Cirrus-CI config for FreeBSD builds

6 years agoAdd support for the 64-bit ar format 1116/head
Gerald NDA [Wed, 9 Jan 2019 19:36:02 +0000 (14:36 -0500)] 
Add support for the 64-bit ar format

6 years agoDo something useful for directories by setting the mask to 0.
Joerg Sonnenberger [Mon, 7 Jan 2019 20:34:28 +0000 (21:34 +0100)] 
Do something useful for directories by setting the mask to 0.

This avoids buffer overflows by always truncating the window correctly.

Reported-By: OSS-Fuzz issue 11011
6 years agoForce intermediate to uint64_t to make UBSAN happy.
Joerg Sonnenberger [Mon, 7 Jan 2019 18:33:25 +0000 (19:33 +0100)] 
Force intermediate to uint64_t to make UBSAN happy.

Reported-By: OSS-Fuzz issue 10843
6 years agoMerge pull request #1085 from Young-X/master
Martin Matuška [Wed, 26 Dec 2018 21:48:23 +0000 (22:48 +0100)] 
Merge pull request #1085 from Young-X/master

Fix a null pointer dereference bug in zip writer.

6 years agoZIP reader: improve checks for existence of liblzma 1110/head
Grzegorz Antoniak [Fri, 21 Dec 2018 05:44:10 +0000 (06:44 +0100)] 
ZIP reader: improve checks for existence of liblzma

For every HAVE_LZMA_H check, include also a check for HAVE_LIBLZMA.

This was done in order to fix build issues in case where the 'lzma.h'
file does exist, but the SO library file doesn't exist.

6 years agoAdded missing files into Makefile.am
Grzegorz Antoniak [Tue, 18 Dec 2018 19:59:21 +0000 (20:59 +0100)] 
Added missing files into Makefile.am

6 years agoZIP reader: added support for XZ, LZMA, PPMD8 and BZIP2 decompression
Grzegorz Antoniak [Sat, 15 Dec 2018 07:38:26 +0000 (08:38 +0100)] 
ZIP reader: added support for XZ, LZMA, PPMD8 and BZIP2 decompression

This commit adds some support for extraction of '.zipx' files. Those
files are standard ZIP files that can contain files compressed with
different set of algorithms that standard '.zip' files use.

Support is still missing for Deflate64, JPEG and WavPack algorithms.

6 years agoMerge pull request #1108 from libarchive/Issue1104
Tim Kientzle [Sat, 15 Dec 2018 20:16:55 +0000 (12:16 -0800)] 
Merge pull request #1108 from libarchive/Issue1104

Issue 1104: Explicitly limit the printed string to 12 characters

6 years agoIssue 1104: Explicitly limit the printed string to 12 characters 1108/head
Tim Kientzle [Sat, 15 Dec 2018 18:40:38 +0000 (10:40 -0800)] 
Issue 1104: Explicitly limit the printed string to 12 characters

GCC8 tries to diagnose `snprintf()` overflows but isn't quite
smart enough for this case, so emits a false-positive warning.

Remember that `%12s` only specifies the minimum number of bytes.  GCC8
conservatively assumes this might result in writing the full length of
`date2`.  (Which will never be longer than 12 bytes, but GCC8
apparently can't reason about `strftime` format specifiers yet.)
Changing the specifier here to `%12.12s` explicitly truncates to 12
bytes and should help the compiler understand that this will never
overflow.

While I'm here, correct a minor typo in the previous line; it used
`sizeof(date)` instead of `sizeof(date2)`.  (Both are the same
size, so this had no functional impact.)

6 years agoMerge pull request #1105 from daxtens/master
Martin Matuška [Thu, 13 Dec 2018 11:09:14 +0000 (12:09 +0100)] 
Merge pull request #1105 from daxtens/master

Fix various crash, memory corruption and infinite loop conditions

6 years agoMerge pull request #1107 from antekone/rar5_unused_functions_pr
Martin Matuška [Thu, 13 Dec 2018 10:57:06 +0000 (11:57 +0100)] 
Merge pull request #1107 from antekone/rar5_unused_functions_pr

RAR5 reader: removed an unused function: bf_is_last_block

6 years agoRAR5 reader: removed an unused function: bf_is_last_block 1107/head
Grzegorz Antoniak [Thu, 13 Dec 2018 05:32:30 +0000 (06:32 +0100)] 
RAR5 reader: removed an unused function: bf_is_last_block

Also added a comment that will allow to easily readd this function in
case it'll be needed.

6 years agowarc: consume data once read 1105/head
Daniel Axtens [Tue, 4 Dec 2018 05:33:42 +0000 (16:33 +1100)] 
warc: consume data once read

The warc decoder only used read ahead, it wouldn't actually consume
data that had previously been printed. This means that if you specify
an invalid content length, it will just reprint the same data over
and over and over again until it hits the desired length.

This means that a WARC resource with e.g.
Content-Length: 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666665
but only a few hundred bytes of data, causes a quasi-infinite loop.

Consume data in subsequent calls to _warc_read.

Found with an AFL + afl-rb + qsym setup.

6 years agoSkip 0-length ACL fields
Daniel Axtens [Tue, 4 Dec 2018 03:29:42 +0000 (14:29 +1100)] 
Skip 0-length ACL fields

Currently, it is possible to create an archive that crashes bsdtar
with a malformed ACL:

Program received signal SIGSEGV, Segmentation fault.
archive_acl_from_text_l (acl=<optimised out>, text=0x7e2e92 "", want_type=<optimised out>, sc=<optimised out>) at libarchive/archive_acl.c:1726
1726 switch (*s) {
(gdb) p n
$1 = 1
(gdb) p field[n]
$2 = {start = 0x0, end = 0x0}

Stop this by checking that the length is not zero before beginning
the switch statement.

I am pretty sure this is the bug mentioned in the qsym paper [1],
and I was able to replicate it with a qsym + AFL + afl-rb setup.

[1] https://www.usenix.org/conference/usenixsecurity18/presentation/yun

6 years agorar: file split across multi-part archives must match
Daniel Axtens [Mon, 3 Dec 2018 13:55:22 +0000 (00:55 +1100)] 
rar: file split across multi-part archives must match

Fuzzing uncovered some UAF and memory overrun bugs where a file in a
single file archive reported that it was split across multiple
volumes. This was caused by ppmd7 operations calling
rar_br_fillup. This would invoke rar_read_ahead, which would in some
situations invoke archive_read_format_rar_read_header.  That would
check the new file name against the old file name, and if they didn't
match up it would free the ppmd7 buffer and allocate a new
one. However, because the ppmd7 decoder wasn't actually done with the
buffer, it would continue to used the freed buffer. Both reads and
writes to the freed region can be observed.

This is quite tricky to solve: once the buffer has been freed it is
too late, as the ppmd7 decoder functions almost universally assume
success - there's no way for ppmd_read to signal error, nor are there
good ways for functions like Range_Normalise to propagate them. So we
can't detect after the fact that we're in an invalid state - e.g. by
checking rar->cursor, we have to prevent ourselves from ever ending up
there. So, when we are in the dangerous part or rar_read_ahead that
assumes a valid split, we set a flag force read_header to either go
down the path for split files or bail. This means that the ppmd7
decoder keeps a valid buffer and just runs out of data.

Found with a combination of AFL, afl-rb and qsym.

6 years agoAvoid a double-free when a window size of 0 is specified
Daniel Axtens [Tue, 20 Nov 2018 06:56:29 +0000 (17:56 +1100)] 
Avoid a double-free when a window size of 0 is specified

new_size can be 0 with a malicious or corrupted RAR archive.

realloc(area, 0) is equivalent to free(area), so the region would
be free()d here and the free()d again in the cleanup function.

Found with a setup running AFL, afl-rb, and qsym.

6 years agoMerge pull request #1102 from antekone/rar5_powerpc_fixes
Martin Matuška [Sun, 9 Dec 2018 22:30:47 +0000 (23:30 +0100)] 
Merge pull request #1102 from antekone/rar5_powerpc_fixes

RAR5 reader: fixed big-endian problems

6 years agoRAR5 reader: fixed big-endian problems 1102/head
Grzegorz Antoniak [Fri, 7 Dec 2018 06:37:30 +0000 (07:37 +0100)] 
RAR5 reader: fixed big-endian problems

The reader has assumed it's running on little-endian. The commit changes
direct memory reads to archive_le* function calls, which should allow
the reader to run on big-endian machines as well.

Changes were needed in the reader itself and in the file holding
reader's test cases.

The commit also removes 1 warning encountered when compiling under GCC
8 on PowerPC architecture.

Fixes #1097

6 years agoSwitch Travis CI Ubuntu distribution from trusty to xenial
Martin Matuska [Wed, 28 Nov 2018 11:13:29 +0000 (12:13 +0100)] 
Switch Travis CI Ubuntu distribution from trusty to xenial

6 years agoMerge pull request #956 from korli/cmakexattr
Martin Matuška [Mon, 26 Nov 2018 21:51:52 +0000 (22:51 +0100)] 
Merge pull request #956 from korli/cmakexattr

CMake: check libgnu for xattr functions on Haiku

6 years agoFix test_extattr_freebsd, can be fully run as non-root now
Martin Matuska [Sun, 25 Nov 2018 11:09:16 +0000 (12:09 +0100)] 
Fix test_extattr_freebsd, can be fully run as non-root now

6 years agoMerge pull request #1023 from eborisch/master
Martin Matuška [Sun, 25 Nov 2018 09:13:08 +0000 (10:13 +0100)] 
Merge pull request #1023 from eborisch/master

If extended attributes or HFS compression are to be extracted as non root, create files owner-writable first.

6 years agoMerge pull request #1089 from DerDakon/cmp0075
Martin Matuška [Sun, 25 Nov 2018 08:03:09 +0000 (09:03 +0100)] 
Merge pull request #1089 from DerDakon/cmp0075

reset CMAKE_REQUIRED_LIBRARIES before checking system headers

6 years agoMerge pull request #1087 from DerDakon/read-var
Martin Matuška [Sun, 25 Nov 2018 08:02:24 +0000 (09:02 +0100)] 
Merge pull request #1087 from DerDakon/read-var

tests: fix compile error with -Wshadow on older gcc releases

6 years agoAllow in-entry comments in SCHILY.acl.*
Martin Matuska [Sun, 25 Nov 2018 03:14:09 +0000 (04:14 +0100)] 
Allow in-entry comments in SCHILY.acl.*

Fixes #1096

6 years agoMerge pull request #1092 from praiskup/resource-leaks-and-strcpy
Martin Matuska [Sat, 24 Nov 2018 00:47:41 +0000 (01:47 +0100)] 
Merge pull request #1092 from praiskup/resource-leaks-and-strcpy

6 years agotar/write.c: call missing archive_read_close() in write_archive()
Martin Matuska [Sat, 24 Nov 2018 00:31:40 +0000 (01:31 +0100)] 
tar/write.c: call missing archive_read_close() in write_archive()

6 years agoMerge pull request #1091 from praiskup/newc-use-after-free
Martin Matuska [Sat, 24 Nov 2018 00:26:32 +0000 (01:26 +0100)] 
Merge pull request #1091 from praiskup/newc-use-after-free

6 years agoFix a few obvious resource leaks and strcpy() misuses 1092/head
Pavel Raiskup [Fri, 23 Nov 2018 12:48:34 +0000 (13:48 +0100)] 
Fix a few obvious resource leaks and strcpy() misuses

Per Coverity report.

6 years agoFix use-after-free in delayed link processing (newc format) 1091/head
Pavel Raiskup [Fri, 23 Nov 2018 13:08:48 +0000 (14:08 +0100)] 
Fix use-after-free in delayed link processing (newc format)

During archiving, if some of the "delayed" hard link entries
happened to disappear on filesystem (or become unreadable) for
some reason (most probably race), the old code free()d the 'entry'
and continued with the loop;  the next loop though dereferenced
'entry' and crashed the archiver.

Per report from Coverity.

6 years agoreset CMAKE_REQUIRED_LIBRARIES before checking system headers 1089/head
Rolf Eike Beer [Wed, 21 Nov 2018 19:50:16 +0000 (20:50 +0100)] 
reset CMAKE_REQUIRED_LIBRARIES before checking system headers

This fixes this CMake warning with CMake 3.12 and newer:

CMake Warning (dev) at /usr/share/cmake/Modules/CheckIncludeFiles.cmake:110 (message):
  Policy CMP0075 is not set: Include file check macros honor
  CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  CMAKE_REQUIRED_LIBRARIES is set to:

    /usr/lib/liblzma.so

  For compatibility with CMake 3.11 and below this check is ignoring it.
Call Stack (most recent call first):
  CMakeLists.txt:602 (CHECK_INCLUDE_FILES)
  CMakeLists.txt:609 (LA_CHECK_INCLUDE_FILE)

6 years agotests: fix compile error with -Wshadow on older gcc releases 1087/head
Rolf Eike Beer [Wed, 21 Nov 2018 19:22:31 +0000 (20:22 +0100)] 
tests: fix compile error with -Wshadow on older gcc releases

Older gcc releases also warn when a local variable has the name of a global
function, like this output from gcc 4.6:

test_read_format_rar5.c:93:23: error: declaration of 'read' shadows a global declaration [-Werror=shadow]

6 years agoFix a null pointer dereference bug in zip writer. 1085/head
Young_X [Mon, 12 Nov 2018 01:20:19 +0000 (09:20 +0800)] 
Fix a null pointer dereference bug in zip writer.

Signed-off-by: Young_X <YangX92@hotmail.com>
6 years agoMerge pull request #1084 from antekone/rar5_bugfixes_pr
Martin Matuška [Sun, 11 Nov 2018 12:01:23 +0000 (13:01 +0100)] 
Merge pull request #1084 from antekone/rar5_bugfixes_pr

RAR5 reader bugfixes

6 years agoRAR5 reader bugfixes (block-by-block, loops, warnings) 1084/head
Grzegorz Antoniak [Fri, 9 Nov 2018 05:01:24 +0000 (06:01 +0100)] 
RAR5 reader bugfixes (block-by-block, loops, warnings)

- Fixed a bug during a block-by-block reading loop. Added a test that
checks for the existence of this bug.

- Fixed 2 unlimited loops encountered when unpacking corrupted data.

- Removed some 'maybe uninitialized' warnings.

6 years agoMerge pull request #1080 from Tarsnap/spelling-upload
Martin Matuška [Sun, 4 Nov 2018 00:06:53 +0000 (01:06 +0100)] 
Merge pull request #1080 from Tarsnap/spelling-upload

Spelling fixes

6 years agoSpelling & grammar fix 1080/head
Graham Percival [Fri, 2 Nov 2018 21:19:11 +0000 (14:19 -0700)] 
Spelling & grammar fix

Sponsored by: Tarsnap Backup Inc.

6 years agoSpelling fixes
Graham Percival [Fri, 2 Nov 2018 21:16:56 +0000 (14:16 -0700)] 
Spelling fixes

Sponsored by: Tarsnap Backup Inc.

6 years agoMerge pull request #1079 from antekone/config_h_entries_for_libb2
Martin Matuška [Mon, 29 Oct 2018 20:32:13 +0000 (21:32 +0100)] 
Merge pull request #1079 from antekone/config_h_entries_for_libb2

RAR5 reader: Added missing config.h entries for libb2

6 years agoAdded missing config.h entries for libb2 1079/head
Grzegorz Antoniak [Sat, 27 Oct 2018 05:45:56 +0000 (07:45 +0200)] 
Added missing config.h entries for libb2

Symbols added: HAVE_LIBB2, HAVE_BLAKE2_H

RAR5 reader sources expect those symbols to be defined when using system
libb2, but the symbols were missing. This commit fixes that.

6 years agoRAR5 reader: more maybe-uninitialized size_t fixes for riscv64 FreeBSD build
Martin Matuska [Fri, 26 Oct 2018 20:21:04 +0000 (22:21 +0200)] 
RAR5 reader: more maybe-uninitialized size_t fixes for riscv64 FreeBSD build

6 years agoRAR5 reader: fix build errors on some FreeBSD platforms
Martin Matuska [Thu, 25 Oct 2018 22:48:19 +0000 (00:48 +0200)] 
RAR5 reader: fix build errors on some FreeBSD platforms
- "index" shadows a global declaration on powerpc(64), mips(64) and sparc64
- avoid unitialized size_t on riscv64

6 years agoRAR5 reader: comment out unused constant
Martin Matuska [Tue, 23 Oct 2018 12:40:44 +0000 (14:40 +0200)] 
RAR5 reader: comment out unused constant

6 years agoRAR5 reader: mark some constants static
Martin Matuska [Tue, 23 Oct 2018 11:30:32 +0000 (13:30 +0200)] 
RAR5 reader: mark some constants static

6 years agoAdded a test demonstrating for GitHub issue 998.
Grzegorz Antoniak [Mon, 26 Feb 2018 19:23:57 +0000 (20:23 +0100)] 
Added a test demonstrating for GitHub issue 998.

Fixes #1013
Fixes #998

6 years agoFix for GitHub issue 998.
Grzegorz Antoniak [Mon, 26 Feb 2018 19:26:33 +0000 (20:26 +0100)] 
Fix for GitHub issue 998.

6 years agoMerge pull requeset #1070 from zweger/master
Martin Matuska [Sat, 6 Oct 2018 20:43:37 +0000 (22:43 +0200)] 
Merge pull requeset #1070 from zweger/master

Don't default XAR entry atime/mtime to the current time

6 years agoAdd RAR 5.0 support to NEWS and README.md
Martin Matuska [Sat, 6 Oct 2018 20:30:41 +0000 (22:30 +0200)] 
Add RAR 5.0 support to NEWS and README.md

6 years agoAdd information about BLAKE2 multi-license to COPYING
Martin Matuska [Sat, 6 Oct 2018 20:13:44 +0000 (22:13 +0200)] 
Add information about BLAKE2 multi-license to COPYING

The BLAKE2 source files are multi-licensed with the ability to choose
between CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses. For libarchive
the CC0 1.0 Universal Public Domain Dedication should be acceptable.

6 years agoarchive_read_support_format_rar5: enable blake2 support via libb2
Martin Matuska [Sat, 6 Oct 2018 19:43:30 +0000 (21:43 +0200)] 
archive_read_support_format_rar5: enable blake2 support via libb2

6 years agoMerge pull request #1061 from antekone/unrar5
Martin Matuska [Thu, 4 Oct 2018 22:42:40 +0000 (00:42 +0200)] 
Merge pull request #1061 from antekone/unrar5

Support for extraction of RAR v5 archives

6 years agoAdd missing RAR5 files to Makefile.am
Martin Matuska [Tue, 2 Oct 2018 00:08:34 +0000 (02:08 +0200)] 
Add missing RAR5 files to Makefile.am

6 years agoRemoved usage of __attribute__ macros and unsafe cast in debug code 1061/head
Grzegorz Antoniak [Thu, 4 Oct 2018 20:01:35 +0000 (22:01 +0200)] 
Removed usage of __attribute__ macros and unsafe cast in debug code

6 years agoFixed broken unit tests in other parts of the project.
Grzegorz Antoniak [Thu, 4 Oct 2018 05:01:51 +0000 (07:01 +0200)] 
Fixed broken unit tests in other parts of the project.

The problem was a bad return value for the set_option() function. This
commit changes this return value to ARCHIVE_WARN, as there currently are
no options to be handled by the decompressor.

6 years agoDon't default XAR entry atime/mtime to the current time 1070/head
Zack Weger [Tue, 2 Oct 2018 22:19:27 +0000 (18:19 -0400)] 
Don't default XAR entry atime/mtime to the current time

6 years agoRefactored tests a little bit, added 2 more tests.
Grzegorz Antoniak [Tue, 2 Oct 2018 05:14:41 +0000 (07:14 +0200)] 
Refactored tests a little bit, added 2 more tests.

6 years agoRevert "xar: fix bad seek in move_reading_point()"
Grzegorz Antoniak [Mon, 1 Oct 2018 09:13:08 +0000 (11:13 +0200)] 
Revert "xar: fix bad seek in move_reading_point()"

This reverts commit 5a837b80fe94cec2aeee77751a9b14386167c509.

6 years agoAdded some unit tests, fixed some bugs, added more comments.
Grzegorz Antoniak [Mon, 1 Oct 2018 05:37:43 +0000 (07:37 +0200)] 
Added some unit tests, fixed some bugs, added more comments.

6 years agoMerge branch 'unrar5' of github.com:antekone/libarchive into unrar5
Grzegorz Antoniak [Wed, 26 Sep 2018 04:25:53 +0000 (06:25 +0200)] 
Merge branch 'unrar5' of github.com:antekone/libarchive into unrar5

6 years agoMerge branch 'unrar5' of github.com:antekone/libarchive into unrar5
Grzegorz Antoniak [Tue, 25 Sep 2018 04:58:51 +0000 (06:58 +0200)] 
Merge branch 'unrar5' of github.com:antekone/libarchive into unrar5

6 years agoAdded support for extraction of RAR v5 archives
Grzegorz Antoniak [Sat, 8 Sep 2018 04:41:28 +0000 (06:41 +0200)] 
Added support for extraction of RAR v5 archives

This is an initial implementation of a stream-oriented unpacker. Things
that should work:

- Extraction of any compression level (stored or compressed), file
  enumeration, skipping through files,
- Support for any dictionary sizes,
- CRC32 and BLAKE2sp checksums,
- Solid archives,
- Multi-volume archives (part001, part002, etc),
- Solid multi-volume archives,
- DELTA, x86 and ARM filter support: other filters are not used
  in version 5 of the format.

Things that are missing from this implementation:

- Encryption support,
- NTFS ACL permission settings,
- Parsing the Reed-Solomon recovery record.

6 years agoMerge branch 'master' of http://github.com/libarchive/libarchive into upstream
Grzegorz Antoniak [Tue, 25 Sep 2018 04:14:37 +0000 (06:14 +0200)] 
Merge branch 'master' of http://github.com/libarchive/libarchive into upstream

6 years agoCorrectly process and verify integer arguments passed to bsdcpio and bsdtar
Martin Matuska [Sat, 22 Sep 2018 22:04:36 +0000 (00:04 +0200)] 
Correctly process and verify integer arguments passed to bsdcpio and bsdtar

Fixes #1068

6 years agoUse PATH_MAX if available for temporary path buffer
Martin Matuska [Thu, 20 Sep 2018 14:52:34 +0000 (16:52 +0200)] 
Use PATH_MAX if available for temporary path buffer
Check if temporary file path fits into buffer

Fixes #1067

6 years agoMerge pull request #1066 from Young-X/master
Martin Matuška [Thu, 20 Sep 2018 12:23:14 +0000 (14:23 +0200)] 
Merge pull request #1066 from Young-X/master

fix several potential vulnerabilities of libarchive

6 years agofix out of bounds read on empty string () filename for guntar, pax and v7tar 1066/head
Young_X [Tue, 18 Sep 2018 12:18:08 +0000 (20:18 +0800)] 
fix out of bounds read on empty string () filename for guntar, pax and v7tar

6 years agoHandle whitespace-only ACL fields correctly.
Joerg Sonnenberger [Sun, 9 Sep 2018 18:31:59 +0000 (20:31 +0200)] 
Handle whitespace-only ACL fields correctly.

The logic would result in possible reads before the start of a buffer.

Reported-By: OSS-Fuzz issue 10192
6 years agoMerge branch 'master' of github.com:antekone/libarchive into upstream
Grzegorz Antoniak [Sun, 9 Sep 2018 07:32:30 +0000 (09:32 +0200)] 
Merge branch 'master' of github.com:antekone/libarchive into upstream

6 years agoMerge pull request #1019 from donmeyer/add_allocation_check
Tim Kientzle [Sat, 8 Sep 2018 19:27:00 +0000 (12:27 -0700)] 
Merge pull request #1019 from donmeyer/add_allocation_check

Add allocation check for the zip_entry struct.

6 years agoMerge pull request #1032 from anthonybrandon/master
Tim Kientzle [Sat, 8 Sep 2018 19:26:03 +0000 (12:26 -0700)] 
Merge pull request #1032 from anthonybrandon/master

Android.mk: update libarchive sources

6 years agoMerge pull request #1037 from NamedKitten/patch-1
Tim Kientzle [Sat, 8 Sep 2018 19:24:51 +0000 (12:24 -0700)] 
Merge pull request #1037 from NamedKitten/patch-1

Remove duplicate line in README.md

6 years agoFix OpenSSL version number
Tim Kientzle [Sat, 8 Sep 2018 19:23:50 +0000 (12:23 -0700)] 
Fix OpenSSL version number

6 years agoMore information about sparse test failures
Tim Kientzle [Sat, 8 Sep 2018 18:26:48 +0000 (11:26 -0700)] 
More information about sparse test failures

6 years agoUse plain OPENSSL_VERSION_NUMBER and also block LibreSSL crap.
Joerg Sonnenberger [Wed, 5 Sep 2018 13:04:12 +0000 (15:04 +0200)] 
Use plain OPENSSL_VERSION_NUMBER and also block LibreSSL crap.

6 years agoRedo OPENSSL_VERSION_AT_LEAST check to deal with CPP idiosyncrasies
Joerg Sonnenberger [Wed, 5 Sep 2018 09:48:07 +0000 (11:48 +0200)] 
Redo OPENSSL_VERSION_AT_LEAST check to deal with CPP idiosyncrasies