From owner-svn-src-all@freebsd.org Thu Oct 25 23:13:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BA5110CCBA4; Thu, 25 Oct 2018 23:13:20 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30AD577C32; Thu, 25 Oct 2018 23:13:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E744C18AC5; Thu, 25 Oct 2018 23:13:19 +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 w9PNDJxd017610; Thu, 25 Oct 2018 23:13:19 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PNDJgd017609; Thu, 25 Oct 2018 23:13:19 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201810252313.w9PNDJgd017609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 25 Oct 2018 23:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339751 - head/contrib/libarchive/libarchive X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: head/contrib/libarchive/libarchive X-SVN-Commit-Revision: 339751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 23:13:20 -0000 Author: mm Date: Thu Oct 25 23:13:19 2018 New Revision: 339751 URL: https://svnweb.freebsd.org/changeset/base/339751 Log: MFV r339750: Sync libarchive with vendor. Relevant vendor changes: RAR5 reader: FreeBSD build platform fixes for powerpc(64), mips(64), sparc64 and riscv64 MFC after: 1 month Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Thu Oct 25 23:10:06 2018 (r339750) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Thu Oct 25 23:13:19 2018 (r339751) @@ -737,11 +737,11 @@ static void dist_cache_push(struct rar5* rar, int valu q[0] = value; } -static int dist_cache_touch(struct rar5* rar, int index) { +static int dist_cache_touch(struct rar5* rar, int idx) { int* q = rar->cstate.dist_cache; - int i, dist = q[index]; + int i, dist = q[idx]; - for(i = index; i > 0; i--) + for(i = idx; i > 0; i--) q[i] = q[i - 1]; q[0] = dist; @@ -1500,10 +1500,10 @@ static int process_head_main(struct archive_read* a, s (void) entry; int ret; - size_t extra_data_size, - extra_field_size, - extra_field_id, - archive_flags; + size_t extra_data_size = 0; + size_t extra_field_size = 0; + size_t extra_field_id = 0; + size_t archive_flags = 0; if(block_flags & HFL_EXTRA_DATA) { if(!read_var_sized(a, &extra_data_size, NULL)) @@ -1528,7 +1528,7 @@ static int process_head_main(struct archive_read* a, s rar->main.solid = (archive_flags & SOLID) > 0; if(archive_flags & VOLUME_NUMBER) { - size_t v; + size_t v = 0; if(!read_var_sized(a, &v, NULL)) { return ARCHIVE_EOF; } @@ -1644,7 +1644,8 @@ static int process_base_block(struct archive_read* a, struct rar5* rar = get_context(a); uint32_t hdr_crc, computed_crc; size_t raw_hdr_size, hdr_size_len, hdr_size; - size_t header_id, header_flags; + size_t header_id = 0; + size_t header_flags = 0; const uint8_t* p; int ret; @@ -2529,8 +2530,8 @@ static int do_uncompress_block(struct archive_read* a, continue; } else if(num < 262) { - const int index = num - 258; - const int dist = dist_cache_touch(rar, index); + const int idx = num - 258; + const int dist = dist_cache_touch(rar, idx); uint16_t len_slot; int len;