From owner-svn-src-vendor@freebsd.org Mon Jun 20 23:55:36 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BB49AC4405; Mon, 20 Jun 2016 23:55:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE5952276; Mon, 20 Jun 2016 23:55:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5KNtZvb071720; Mon, 20 Jun 2016 23:55:35 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5KNtXAj071708; Mon, 20 Jun 2016 23:55:33 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201606202355.u5KNtXAj071708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 20 Jun 2016 23:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r302037 - in vendor/libarchive/dist: . build libarchive libarchive/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 23:55:36 -0000 Author: mm Date: Mon Jun 20 23:55:33 2016 New Revision: 302037 URL: https://svnweb.freebsd.org/changeset/base/302037 Log: Update vendor/libarchive to git 139d0576b51a253732a5ab1f66805dffbf8b00af tag v3.2.1 Fixed vendor issues: Issue 521: Properly check reading from lzss decompression buffer Issue 717: Fix integer overflow when computing location of volume descriptor Issue 718: Security fix TALOS-CAN-152 Issue 719: Security fix TALOS-CAN-154 Security: TALOS-CAN-152, TALOS-CAN-154 Modified: vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/build/version vendor/libarchive/dist/configure.ac vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/archive_entry.h vendor/libarchive/dist/libarchive/archive_ppmd7.c vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/test_write_format_gnutar_filenames.c Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/Makefile.am Mon Jun 20 23:55:33 2016 (r302037) @@ -454,6 +454,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_read_format_rar_encryption_data.c \ libarchive/test/test_read_format_rar_encryption_partially.c \ libarchive/test/test_read_format_rar_encryption_header.c \ + libarchive/test/test_read_format_rar_invalid1.c \ libarchive/test/test_read_format_raw.c \ libarchive/test/test_read_format_tar.c \ libarchive/test/test_read_format_tar_concatenated.c \ @@ -747,6 +748,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_rar_encryption_data.rar.uu \ libarchive/test/test_read_format_rar_encryption_header.rar.uu \ libarchive/test/test_read_format_rar_encryption_partially.rar.uu \ + libarchive/test/test_read_format_rar_invalid1.rar.uu \ libarchive/test/test_read_format_rar_multi_lzss_blocks.rar.uu \ libarchive/test/test_read_format_rar_multivolume.part0001.rar.uu \ libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu \ Modified: vendor/libarchive/dist/NEWS ============================================================================== --- vendor/libarchive/dist/NEWS Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/NEWS Mon Jun 20 23:55:33 2016 (r302037) @@ -1,3 +1,8 @@ +Jun 20, 2016: libarchive 3.2.1 released + This fixes a handful of security and other critical issues with 3.2.0 + +May 01, 2016: libarchive 3.2.0 released + Apr 09, 2016: libarchive 3.1.901a released Another test release in preparation for 3.2.0 Modified: vendor/libarchive/dist/build/version ============================================================================== --- vendor/libarchive/dist/build/version Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/build/version Mon Jun 20 23:55:33 2016 (r302037) @@ -1 +1 @@ -3002000 +3002001 Modified: vendor/libarchive/dist/configure.ac ============================================================================== --- vendor/libarchive/dist/configure.ac Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/configure.ac Mon Jun 20 23:55:33 2016 (r302037) @@ -4,8 +4,8 @@ dnl First, define all of the version num 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.2.0]) -m4_define([LIBARCHIVE_VERSION_N],[3002000]) +m4_define([LIBARCHIVE_VERSION_S],[3.2.1]) +m4_define([LIBARCHIVE_VERSION_N],[3002001]) dnl bsdtar and bsdcpio versioning tracks libarchive m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S()) Modified: vendor/libarchive/dist/libarchive/archive.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive.h Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/libarchive/archive.h Mon Jun 20 23:55:33 2016 (r302037) @@ -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 3002000 +#define ARCHIVE_VERSION_NUMBER 3002001 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(vo /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.2.0" +#define ARCHIVE_VERSION_ONLY_STRING "3.2.1" #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 Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/libarchive/archive_entry.h Mon Jun 20 23:55:33 2016 (r302037) @@ -29,7 +29,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3002000 +#define ARCHIVE_VERSION_NUMBER 3002001 /* * Note: archive_entry.h is for use outside of libarchive; the Modified: vendor/libarchive/dist/libarchive/archive_ppmd7.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_ppmd7.c Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/libarchive/archive_ppmd7.c Mon Jun 20 23:55:33 2016 (r302037) @@ -126,6 +126,11 @@ static Bool Ppmd7_Alloc(CPpmd7 *p, UInt3 { if (p->Base == 0 || p->Size != size) { + /* RestartModel() below assumes that p->Size >= UNIT_SIZE + (see the calculation of m->MinContext). */ + if (size < UNIT_SIZE) { + return False; + } Ppmd7_Free(p, alloc); p->AlignOffset = #ifdef PPMD_32BIT Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c Mon Jun 20 23:55:33 2016 (r302037) @@ -2153,6 +2153,9 @@ read_SubStreamsInfo(struct archive_read return (-1); if (UMAX_ENTRY < f[i].numUnpackStreams) return (-1); + if (unpack_streams > SIZE_MAX - UMAX_ENTRY) { + return (-1); + } unpack_streams += (size_t)f[i].numUnpackStreams; } if ((p = header_bytes(a, 1)) == NULL) Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Mon Jun 20 23:55:33 2016 (r302037) @@ -1091,7 +1091,7 @@ choose_volume(struct archive_read *a, st /* This condition is unlikely; by way of caution. */ vd = &(iso9660->joliet); - skipsize = LOGICAL_BLOCK_SIZE * vd->location; + skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location; skipsize = __archive_read_consume(a, skipsize); if (skipsize < 0) return ((int)skipsize); @@ -1129,7 +1129,7 @@ choose_volume(struct archive_read *a, st && iso9660->seenJoliet) { /* Switch reading data from primary to joliet. */ vd = &(iso9660->joliet); - skipsize = LOGICAL_BLOCK_SIZE * vd->location; + skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location; skipsize -= iso9660->current_position; skipsize = __archive_read_consume(a, skipsize); if (skipsize < 0) Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c Mon Jun 20 23:55:33 2016 (r302037) @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a) rar->range_dec.Stream = &rar->bytein; __archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context); + if (rar->dictionary_size == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Invalid zero dictionary size"); + return (ARCHIVE_FATAL); + } + if (!__archive_ppmd7_functions.Ppmd7_Alloc(&rar->ppmd7_context, rar->dictionary_size, &g_szalloc)) { @@ -2884,11 +2890,10 @@ copy_from_lzss_window(struct archive_rea } windowoffs = lzss_offset_for_position(&rar->lzss, startpos); - if(windowoffs + length <= lzss_size(&rar->lzss)) + if(windowoffs + length <= lzss_size(&rar->lzss)) { memcpy(&rar->unp_buffer[rar->unp_offset], &rar->lzss.window[windowoffs], length); - else - { + } else if (length <= lzss_size(&rar->lzss)) { firstpart = lzss_size(&rar->lzss) - windowoffs; if (firstpart < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, @@ -2900,9 +2905,14 @@ copy_from_lzss_window(struct archive_rea &rar->lzss.window[windowoffs], firstpart); memcpy(&rar->unp_buffer[rar->unp_offset + firstpart], &rar->lzss.window[0], length - firstpart); - } else + } else { memcpy(&rar->unp_buffer[rar->unp_offset], &rar->lzss.window[windowoffs], length); + } + } else { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Bad RAR file data"); + return (ARCHIVE_FATAL); } rar->unp_offset += length; if (rar->unp_offset >= rar->unp_buffer_size) Modified: vendor/libarchive/dist/libarchive/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/libarchive/test/CMakeLists.txt Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/libarchive/test/CMakeLists.txt Mon Jun 20 23:55:33 2016 (r302037) @@ -143,6 +143,7 @@ IF(ENABLE_TEST) test_read_format_rar_encryption_data.c test_read_format_rar_encryption_header.c test_read_format_rar_encryption_partially.c + test_read_format_rar_invalid1.c test_read_format_raw.c test_read_format_tar.c test_read_format_tar_concatenated.c Modified: vendor/libarchive/dist/libarchive/test/test_write_format_gnutar_filenames.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/test_write_format_gnutar_filenames.c Mon Jun 20 23:17:00 2016 (r302036) +++ vendor/libarchive/dist/libarchive/test/test_write_format_gnutar_filenames.c Mon Jun 20 23:55:33 2016 (r302037) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); * reads back to verify it. */ -static char filename[1024]; +static char filename[2048]; DEFINE_TEST(test_write_format_gnutar_filenames) { From owner-svn-src-vendor@freebsd.org Tue Jun 21 00:00:07 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42C11AC46FE; Tue, 21 Jun 2016 00:00:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02EB42541; Tue, 21 Jun 2016 00:00:06 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5L006WN071968; Tue, 21 Jun 2016 00:00:06 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5L006n4071966; Tue, 21 Jun 2016 00:00:06 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201606210000.u5L006n4071966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 21 Jun 2016 00:00:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r302038 - vendor/libarchive/dist/libarchive/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 00:00:07 -0000 Author: mm Date: Tue Jun 21 00:00:05 2016 New Revision: 302038 URL: https://svnweb.freebsd.org/changeset/base/302038 Log: Add two missing test files in r302037 Added: vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.rar.uu Added: vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.c Tue Jun 21 00:00:05 2016 (r302038) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2003-2016 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_read_format_rar_invalid1) +{ + const char *refname = "test_read_format_rar_invalid1.rar"; + struct archive *a; + struct archive_entry *ae; + char *buff[100]; + + extract_reference_file(refname); + 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)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 10240)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_FATAL, archive_read_data(a, buff, 99)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} Added: vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.rar.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.rar.uu Tue Jun 21 00:00:05 2016 (r302038) @@ -0,0 +1,5 @@ +begin 644 test_read_format_rar_invalid1.rar +M4F%R(1H'`,^0B$4= +2,P0`I($``'1E Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DD40AC4795; Tue, 21 Jun 2016 00:01:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16F3027A9; Tue, 21 Jun 2016 00:01:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5L0125M072355; Tue, 21 Jun 2016 00:01:02 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5L012Wu072338; Tue, 21 Jun 2016 00:01:02 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201606210001.u5L012Wu072338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 21 Jun 2016 00:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r302039 - vendor/libarchive/3.2.1 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 00:01:03 -0000 Author: mm Date: Tue Jun 21 00:01:02 2016 New Revision: 302039 URL: https://svnweb.freebsd.org/changeset/base/302039 Log: Tag libarchive 3.2.1 Added: vendor/libarchive/3.2.1/ - copied from r302038, vendor/libarchive/dist/ From owner-svn-src-vendor@freebsd.org Tue Jun 21 15:18:24 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D449AC5C76; Tue, 21 Jun 2016 15:18:24 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D408D1788; Tue, 21 Jun 2016 15:18:23 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5LFIN2S022055; Tue, 21 Jun 2016 15:18:23 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LFIMSg022047; Tue, 21 Jun 2016 15:18:22 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201606211518.u5LFIMSg022047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 21 Jun 2016 15:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r302056 - in vendor/libarchive/dist: . cpio cpio/test libarchive libarchive_fe X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 15:18:24 -0000 Author: mm Date: Tue Jun 21 15:18:22 2016 New Revision: 302056 URL: https://svnweb.freebsd.org/changeset/base/302056 Log: Update vendor/libarchive to git f502a81fcd7c331204bf53cc40cbf966ebb28a42 Modified: vendor/libarchive/dist/configure.ac vendor/libarchive/dist/cpio/cpio.c vendor/libarchive/dist/cpio/test/test_option_version.c vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c vendor/libarchive/dist/libarchive_fe/passphrase.c Modified: vendor/libarchive/dist/configure.ac ============================================================================== --- vendor/libarchive/dist/configure.ac Tue Jun 21 14:16:32 2016 (r302055) +++ vendor/libarchive/dist/configure.ac Tue Jun 21 15:18:22 2016 (r302056) @@ -27,6 +27,7 @@ AC_CONFIG_AUX_DIR([build/autoconf]) AC_CONFIG_MACRO_DIR([build/autoconf]) # Must follow AC_CONFIG macros above... AM_INIT_AUTOMAKE() +AM_MAINTAINER_MODE([enable]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # Libtool's "interface version" can be computed from the libarchive version. @@ -845,6 +846,7 @@ if test "x$with_openssl" != "xno"; then else AC_CHECK_FUNCS([PKCS5_PBKDF2_HMAC_SHA1]) fi + AC_CHECK_LIB(crypto,EVP_CIPHER_CTX_init) fi # Probe libmd AFTER OpenSSL/libcrypto. Modified: vendor/libarchive/dist/cpio/cpio.c ============================================================================== --- vendor/libarchive/dist/cpio/cpio.c Tue Jun 21 14:16:32 2016 (r302055) +++ vendor/libarchive/dist/cpio/cpio.c Tue Jun 21 15:18:22 2016 (r302056) @@ -498,7 +498,7 @@ long_help(void) static void version(void) { - fprintf(stdout,"bsdcpio %s -- %s\n", + fprintf(stdout,"bsdcpio %s - %s\n", BSDCPIO_VERSION_STRING, archive_version_details()); exit(0); Modified: vendor/libarchive/dist/cpio/test/test_option_version.c ============================================================================== --- vendor/libarchive/dist/cpio/test/test_option_version.c Tue Jun 21 14:16:32 2016 (r302055) +++ vendor/libarchive/dist/cpio/test/test_option_version.c Tue Jun 21 15:18:22 2016 (r302056) @@ -59,8 +59,8 @@ verify(const char *p, size_t s) ++q; --s; /* Separator. */ failure("Version: %s", p); - assertEqualMem(q, "-- ", 3); - q += 3; s -= 3; + assertEqualMem(q, "- ", 2); + q += 2; s -= 2; /* libarchive name and version number */ assert(s > 11); failure("Version: %s", p); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c Tue Jun 21 14:16:32 2016 (r302055) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c Tue Jun 21 15:18:22 2016 (r302056) @@ -1712,6 +1712,7 @@ lha_crc16(uint16_t crc, const void *pp, for (;len >= 8; len -= 8) { /* This if statement expects compiler optimization will * remove the stament which will not be executed. */ +#undef bswap16 #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) #elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8) \ Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c Tue Jun 21 14:16:32 2016 (r302055) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c Tue Jun 21 15:18:22 2016 (r302056) @@ -535,7 +535,8 @@ xstrpisotime(const char *s, char **endpt /* as a courtesy to our callers, and since this is a non-standard * routine, we skip leading whitespace */ - for (; isspace(*s); s++); + while (isspace((unsigned char)*s)) + ++s; /* read year */ if ((tm.tm_year = strtoi_lim(s, &s, 1583, 4095)) < 0 || *s++ != '-') { @@ -639,7 +640,9 @@ _warc_rdtyp(const char *buf, size_t bsz) return WT_NONE; } /* overread whitespace */ - for (val += sizeof(_key) - 1U; val < eob && isspace(*val); val++); + val += sizeof(_key) - 1U; + while (val < eob && isspace((unsigned char)*val)) + ++val; if (val + 8U > eob) { ; @@ -676,7 +679,9 @@ _warc_rduri(const char *buf, size_t bsz) return res; } /* overread whitespace */ - for (val += sizeof(_key) - 1U; val < eob && isspace(*val); val++); + val += sizeof(_key) - 1U; + while (val < eob && isspace((unsigned char)*val)) + ++val; /* overread URL designators */ if ((uri = xmemmem(val, eob - val, "://", 3U)) == NULL) { @@ -692,7 +697,8 @@ _warc_rduri(const char *buf, size_t bsz) /* also massage eol to point to the first whitespace * after the last non-whitespace character before * the end of the line */ - for (; eol > uri && isspace(eol[-1]); eol--); + while (eol > uri && isspace((unsigned char)eol[-1])) + --eol; /* now then, inspect the URI */ if (memcmp(val, "file", 4U) == 0) { @@ -727,7 +733,7 @@ _warc_rdlen(const char *buf, size_t bsz) /* strtol kindly overreads whitespace for us, so use that */ val += sizeof(_key) - 1U; len = strtol(val, &on, 10); - if (on == NULL || !isspace(*on)) { + if (on == NULL || !isspace((unsigned char)*on)) { /* hm, can we trust that number? Best not. */ return -1; } @@ -750,7 +756,7 @@ _warc_rdrtm(const char *buf, size_t bsz) /* xstrpisotime() kindly overreads whitespace for us, so use that */ val += sizeof(_key) - 1U; res = xstrpisotime(val, &on); - if (on == NULL || !isspace(*on)) { + if (on == NULL || !isspace((unsigned char)*on)) { /* hm, can we trust that number? Best not. */ return (time_t)-1; } @@ -773,7 +779,7 @@ _warc_rdmtm(const char *buf, size_t bsz) /* xstrpisotime() kindly overreads whitespace for us, so use that */ val += sizeof(_key) - 1U; res = xstrpisotime(val, &on); - if (on == NULL || !isspace(*on)) { + if (on == NULL || !isspace((unsigned char)*on)) { /* hm, can we trust that number? Best not. */ return (time_t)-1; } Modified: vendor/libarchive/dist/libarchive_fe/passphrase.c ============================================================================== --- vendor/libarchive/dist/libarchive_fe/passphrase.c Tue Jun 21 14:16:32 2016 (r302055) +++ vendor/libarchive/dist/libarchive_fe/passphrase.c Tue Jun 21 15:18:22 2016 (r302056) @@ -121,14 +121,15 @@ readpassphrase(const char *prompt, char #else /* _WIN32 && !__CYGWIN__ */ -#include -#include +#include #include #include #ifdef HAVE_PATHS_H #include #endif +#include #include +#include #include #ifdef TCSASOFT @@ -142,11 +143,18 @@ readpassphrase(const char *prompt, char # define _POSIX_VDISABLE VDISABLE #endif -static volatile sig_atomic_t *signo; +#define M(a,b) (a > b ? a : b) +#define MAX_SIGNO M(M(M(SIGALRM, SIGHUP), \ + M(SIGINT, SIGPIPE)), \ + M(M(SIGQUIT, SIGTERM), \ + M(M(SIGTSTP, SIGTTIN), SIGTTOU))) + +static volatile sig_atomic_t signo[MAX_SIGNO + 1]; static void handler(int s) { + assert(s <= MAX_SIGNO); signo[s] = 1; } @@ -166,12 +174,8 @@ readpassphrase(const char *prompt, char return(NULL); } - if (signo == NULL) { - signo = calloc(SIGRTMAX, sizeof(sig_atomic_t)); - } - restart: - for (i = 0; i < SIGRTMAX; i++) + for (i = 0; i <= MAX_SIGNO; i++) signo[i] = 0; nr = -1; save_errno = 0; @@ -198,6 +202,7 @@ restart: sigemptyset(&sa.sa_mask); sa.sa_flags = 0; /* don't restart system calls */ sa.sa_handler = handler; + /* Keep this list in sync with MAX_SIGNO! */ (void)sigaction(SIGALRM, &sa, &savealrm); (void)sigaction(SIGHUP, &sa, &savehup); (void)sigaction(SIGINT, &sa, &saveint); @@ -237,11 +242,11 @@ restart: if (p < end) { if ((flags & RPP_SEVENBIT)) ch &= 0x7f; - if (isalpha(ch)) { + if (isalpha((unsigned char)ch)) { if ((flags & RPP_FORCELOWER)) - ch = (char)tolower(ch); + ch = (char)tolower((unsigned char)ch); if ((flags & RPP_FORCEUPPER)) - ch = (char)toupper(ch); + ch = (char)toupper((unsigned char)ch); } *p++ = ch; } @@ -276,7 +281,7 @@ restart: * If we were interrupted by a signal, resend it to ourselves * now that we have restored the signal handlers. */ - for (i = 0; i < SIGRTMAX; i++) { + for (i = 0; i <= MAX_SIGNO; i++) { if (signo[i]) { kill(getpid(), i); switch (i) {