svn commit: r368607 - in vendor/libarchive/dist: . build build/cmake contrib libarchive libarchive/test

Martin Matuska mm at FreeBSD.org
Sun Dec 13 15:29:22 UTC 2020


Author: mm
Date: Sun Dec 13 15:29:19 2020
New Revision: 368607
URL: https://svnweb.freebsd.org/changeset/base/368607

Log:
  Update vendor/libarchive/dist to b2c3ee7e2907511533eeb2a0f2ceecc1faa73185
  
  Vendor changes:
    Issue #1461: Unbreak build without lzma
    Issue #1462: warc reader: Fix build with gcc11
    Issue #1463: Fix code compatibility in test_archive_read_support.c
    Issue #1464: Use built-in strnlen on platforms where not available
    Issue #1465: warc reader: fix undefined behaviour in deconst() function

Modified:
  vendor/libarchive/dist/CMakeLists.txt
  vendor/libarchive/dist/build/cmake/config.h.in
  vendor/libarchive/dist/build/version
  vendor/libarchive/dist/configure.ac
  vendor/libarchive/dist/contrib/libarchive.spec
  vendor/libarchive/dist/libarchive/archive.h
  vendor/libarchive/dist/libarchive/archive_entry.h
  vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c
  vendor/libarchive/dist/libarchive/test/test_archive_read_support.c

Modified: vendor/libarchive/dist/CMakeLists.txt
==============================================================================
--- vendor/libarchive/dist/CMakeLists.txt	Sun Dec 13 09:38:50 2020	(r368606)
+++ vendor/libarchive/dist/CMakeLists.txt	Sun Dec 13 15:29:19 2020	(r368607)
@@ -18,7 +18,7 @@ endif()
 #   RelWithDebInfo : Release build with Debug Info
 #   MinSizeRel     : Release Min Size build
 IF(NOT CMAKE_BUILD_TYPE)
-  SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
+  SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE)
 ENDIF(NOT CMAKE_BUILD_TYPE)
 # Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the
 # value type is "UNINITIALIZED".
@@ -1378,6 +1378,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(strchr HAVE_STRCHR)
 CHECK_FUNCTION_EXISTS_GLIBC(strdup HAVE_STRDUP)
 CHECK_FUNCTION_EXISTS_GLIBC(strerror HAVE_STRERROR)
 CHECK_FUNCTION_EXISTS_GLIBC(strncpy_s HAVE_STRNCPY_S)
+CHECK_FUNCTION_EXISTS_GLIBC(strnlen HAVE_STRNLEN)
 CHECK_FUNCTION_EXISTS_GLIBC(strrchr HAVE_STRRCHR)
 CHECK_FUNCTION_EXISTS_GLIBC(symlink HAVE_SYMLINK)
 CHECK_FUNCTION_EXISTS_GLIBC(timegm HAVE_TIMEGM)

Modified: vendor/libarchive/dist/build/cmake/config.h.in
==============================================================================
--- vendor/libarchive/dist/build/cmake/config.h.in	Sun Dec 13 09:38:50 2020	(r368606)
+++ vendor/libarchive/dist/build/cmake/config.h.in	Sun Dec 13 15:29:19 2020	(r368607)
@@ -959,6 +959,9 @@ typedef uint64_t uintmax_t;
 /* Define to 1 if you have the `strchr' function. */
 #cmakedefine HAVE_STRCHR 1
 
+/* Define to 1 if you have the `strnlen' function. */
+#cmakedefine HAVE_STRNLEN 1
+
 /* Define to 1 if you have the `strdup' function. */
 #cmakedefine HAVE_STRDUP 1
 

Modified: vendor/libarchive/dist/build/version
==============================================================================
--- vendor/libarchive/dist/build/version	Sun Dec 13 09:38:50 2020	(r368606)
+++ vendor/libarchive/dist/build/version	Sun Dec 13 15:29:19 2020	(r368607)
@@ -1 +1 @@
-3005000
+3005001dev

Modified: vendor/libarchive/dist/configure.ac
==============================================================================
--- vendor/libarchive/dist/configure.ac	Sun Dec 13 09:38:50 2020	(r368606)
+++ vendor/libarchive/dist/configure.ac	Sun Dec 13 15:29:19 2020	(r368607)
@@ -4,8 +4,8 @@ dnl First, define all of the version numbers up front.
 dnl In particular, this allows the version macro to be used in AC_INIT
 
 dnl These first two version numbers are updated automatically on each release.
-m4_define([LIBARCHIVE_VERSION_S],[3.5.0])
-m4_define([LIBARCHIVE_VERSION_N],[3005000])
+m4_define([LIBARCHIVE_VERSION_S],[3.5.1dev])
+m4_define([LIBARCHIVE_VERSION_N],[3005001])
 
 dnl bsdtar and bsdcpio versioning tracks libarchive
 m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S())
@@ -654,8 +654,8 @@ AC_CHECK_FUNCS([mkdir mkfifo mknod mkstemp])
 AC_CHECK_FUNCS([nl_langinfo openat pipe poll posix_spawnp readlink readlinkat])
 AC_CHECK_FUNCS([readpassphrase])
 AC_CHECK_FUNCS([select setenv setlocale sigaction statfs statvfs])
-AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strrchr symlink timegm])
-AC_CHECK_FUNCS([tzset unlinkat unsetenv utime utimensat utimes vfork])
+AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strnlen strrchr symlink])
+AC_CHECK_FUNCS([timegm tzset unlinkat unsetenv utime utimensat utimes vfork])
 AC_CHECK_FUNCS([wcrtomb wcscmp wcscpy wcslen wctomb wmemcmp wmemcpy wmemmove])
 AC_CHECK_FUNCS([_ctime64_s _fseeki64])
 AC_CHECK_FUNCS([_get_timezone _gmtime64_s _localtime64_s _mkgmtime64])

Modified: vendor/libarchive/dist/contrib/libarchive.spec
==============================================================================
--- vendor/libarchive/dist/contrib/libarchive.spec	Sun Dec 13 09:38:50 2020	(r368606)
+++ vendor/libarchive/dist/contrib/libarchive.spec	Sun Dec 13 15:29:19 2020	(r368607)
@@ -1,5 +1,5 @@
 Name:           {{{ git_name }}}
-Version:        {{{ git_version lead=3 follow=4 }}}
+Version:        {{{ git_version lead=3 follow=5 }}}
 Release:        1%{?dist}
 Summary:        A library for handling streaming archive formats
 

Modified: vendor/libarchive/dist/libarchive/archive.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive.h	Sun Dec 13 09:38:50 2020	(r368606)
+++ vendor/libarchive/dist/libarchive/archive.h	Sun Dec 13 15:29:19 2020	(r368607)
@@ -36,7 +36,7 @@
  * assert that ARCHIVE_VERSION_NUMBER >= 2012108.
  */
 /* Note: Compiler will complain if this does not match archive_entry.h! */
-#define	ARCHIVE_VERSION_NUMBER 3005000
+#define	ARCHIVE_VERSION_NUMBER 3005001
 
 #include <sys/stat.h>
 #include <stddef.h>  /* for wchar_t */
@@ -155,7 +155,7 @@ __LA_DECL int		archive_version_number(void);
 /*
  * Textual name/version of the library, useful for version displays.
  */
-#define	ARCHIVE_VERSION_ONLY_STRING "3.5.0"
+#define	ARCHIVE_VERSION_ONLY_STRING "3.5.1dev"
 #define	ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
 __LA_DECL const char *	archive_version_string(void);
 

Modified: vendor/libarchive/dist/libarchive/archive_entry.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_entry.h	Sun Dec 13 09:38:50 2020	(r368606)
+++ vendor/libarchive/dist/libarchive/archive_entry.h	Sun Dec 13 15:29:19 2020	(r368607)
@@ -30,7 +30,7 @@
 #define	ARCHIVE_ENTRY_H_INCLUDED
 
 /* Note: Compiler will complain if this does not match archive.h! */
-#define	ARCHIVE_VERSION_NUMBER 3005000
+#define	ARCHIVE_VERSION_NUMBER 3005001
 
 /*
  * Note: archive_entry.h is for use outside of libarchive; the

Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c	Sun Dec 13 09:38:50 2020	(r368606)
+++ vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c	Sun Dec 13 15:29:19 2020	(r368607)
@@ -136,6 +136,9 @@ static int	skip(struct archive_read *a);
 static int	read_header(struct archive_read *,
 		    struct archive_entry *);
 static int64_t	mtree_atol(char **, int base);
+#ifndef HAVE_STRNLEN
+static size_t	mtree_strnlen(const char *, size_t);
+#endif
 
 /*
  * There's no standard for TIME_T_MAX/TIME_T_MIN.  So we compute them
@@ -187,6 +190,24 @@ get_time_t_min(void)
 #endif
 }
 
+#ifdef HAVE_STRNLEN
+#define mtree_strnlen(a,b) strnlen(a,b)
+#else
+static size_t
+mtree_strnlen(const char *p, size_t maxlen)
+{
+	size_t i;
+
+	for (i = 0; i <= maxlen; i++) {
+		if (p[i] == 0)
+			break;
+	}
+	if (i > maxlen)
+		return (-1);/* invalid */
+	return (i);
+}
+#endif
+
 static int
 archive_read_format_mtree_options(struct archive_read *a,
     const char *key, const char *val)
@@ -1540,7 +1561,7 @@ parse_digest(struct archive_read *a, struct archive_en
 
 	len *= 2;
 
-	if (strnlen(digest, len+1) != len) {
+	if (mtree_strnlen(digest, len+1) != len) {
 		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 				  "incorrect digest length, ignoring");
 		return ARCHIVE_WARN;

Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c	Sun Dec 13 09:38:50 2020	(r368606)
+++ vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c	Sun Dec 13 15:29:19 2020	(r368607)
@@ -127,7 +127,7 @@ static int _warc_skip(struct archive_read *a);
 static int _warc_rdhdr(struct archive_read *a, struct archive_entry *e);
 
 /* private routines */
-static unsigned int _warc_rdver(const char buf[10], size_t bsz);
+static unsigned int _warc_rdver(const char *buf, size_t bsz);
 static unsigned int _warc_rdtyp(const char *buf, size_t bsz);
 static warc_string_t _warc_rduri(const char *buf, size_t bsz);
 static ssize_t _warc_rdlen(const char *buf, size_t bsz);
@@ -443,7 +443,7 @@ _warc_skip(struct archive_read *a)
 static void*
 deconst(const void *c)
 {
-	return (char *)0x1 + (((const char *)c) - (const char *)0x1);
+	return (void *)(uintptr_t)c;
 }
 
 static char*

Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c	Sun Dec 13 09:38:50 2020	(r368606)
+++ vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c	Sun Dec 13 15:29:19 2020	(r368607)
@@ -899,6 +899,7 @@ process_extra(struct archive_read *a, struct archive_e
 	return ARCHIVE_OK;
 }
 
+#if HAVE_LZMA_H && HAVE_LIBLZMA
 /*
  * Auxiliary function to uncompress data chunk from zipx archive
  * (zip with lzma compression).
@@ -971,6 +972,7 @@ zipx_lzma_uncompress_buffer(const char *compressed_buf
 	free(lzma_alone_compressed_buffer);
 	return status;
 }
+#endif
 
 /*
  * Assumes file pointer is at beginning of local file header.

Modified: vendor/libarchive/dist/libarchive/test/test_archive_read_support.c
==============================================================================
--- vendor/libarchive/dist/libarchive/test/test_archive_read_support.c	Sun Dec 13 09:38:50 2020	(r368606)
+++ vendor/libarchive/dist/libarchive/test/test_archive_read_support.c	Sun Dec 13 15:29:19 2020	(r368607)
@@ -126,7 +126,9 @@ DEFINE_TEST(test_archive_read_support)
 	    ARCHIVE_FORMAT_WARC,
 	    ARCHIVE_FORMAT_RAR_V5,
 	};
-	for (unsigned i = 0; i < sizeof(format_codes) / sizeof(int); i++) {
+	unsigned int i;
+
+	for (i = 0; i < sizeof(format_codes) / sizeof(int); i++) {
 		format_code = format_codes[i];
 		test_filter_or_format(format_code_enabler);
 		test_filter_or_format(format_code_setter);


More information about the svn-src-all mailing list