aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/test/test_open_fd.c
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2019-12-28 23:40:32 +0000
committerMartin Matuska <mm@FreeBSD.org>2019-12-28 23:40:32 +0000
commit6922acad9a482c17c7af1acdb4d11d03f19bb1dc (patch)
treeb7e2717582504805f31e2195f7c74c5d6fa82a45 /libarchive/test/test_open_fd.c
parenta297901e6c90d415ac49c88002dd4e02dc49e32b (diff)
downloadsrc-6922acad9a482c17c7af1acdb4d11d03f19bb1dc.tar.gz
src-6922acad9a482c17c7af1acdb4d11d03f19bb1dc.zip
Update vendor/libarchive/dist to git 1dae5a549fe4ab99fd3a49a9edcf897a7b2b1844
Relevant vendor changes: Issue #351: Refactor and implement private state logic for write filters PR #1252: RAR5 reader - verify window size for solid files (OSS-Fuzz 15482) PR #1255: zip writer - don't append unused NUL for directories PR #1260: Fix sparse file offset overflow on 32-bit systems PR #1263: UNICODE filename support for reading lha/lzh format Issue #1276: Bugfix and optimize archive_wstring_append_from_mbs() PR #1288: Add the "xattrhdr" option to pax write options PR #1295: 7z reader - fix reading archives with digests in PackInfo PR #1296: RAR5 reader - verify window size for multivolume archives PR #1297: ZIP reader - support LZMA_STREAM_END marker in 'lzma alone' files Issue #1298: Fix a heap-buffer-overflow in archive_string_append_from_wcs() OSS-Fuzz 19360, 19362: LHA reader - plug two memory leaks on error Fix possible off-by-one when dealing with readlink(2)
Notes
Notes: svn path=/vendor/libarchive/dist/; revision=356163
Diffstat (limited to 'libarchive/test/test_open_fd.c')
-rw-r--r--libarchive/test/test_open_fd.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/libarchive/test/test_open_fd.c b/libarchive/test/test_open_fd.c
index ff5fab1ad45b..7da8b5ebcb56 100644
--- a/libarchive/test/test_open_fd.c
+++ b/libarchive/test/test_open_fd.c
@@ -42,6 +42,7 @@ DEFINE_TEST(test_open_fd)
struct archive_entry *ae;
struct archive *a;
int fd;
+ const char *skip_open_fd_err_test;
#if defined(__BORLANDC__)
fd = open("test.tar", O_RDWR | O_CREAT | O_BINARY);
@@ -116,16 +117,18 @@ DEFINE_TEST(test_open_fd)
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
close(fd);
-
- /*
- * Verify some of the error handling.
- */
- assert((a = archive_read_new()) != NULL);
- assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
- assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
- /* FD 100 shouldn't be open. */
- assertEqualIntA(a, ARCHIVE_FATAL,
- archive_read_open_fd(a, 100, 512));
- assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
- assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+ skip_open_fd_err_test = getenv("SKIP_OPEN_FD_ERR_TEST");
+ if(skip_open_fd_err_test == NULL) {
+ /*
+ * Verify some of the error handling.
+ */
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
+ /* FD 100 shouldn't be open. */
+ assertEqualIntA(a, ARCHIVE_FATAL,
+ archive_read_open_fd(a, 100, 512));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+ }
}