From owner-svn-src-head@freebsd.org Sat Jul 28 01:00:00 2018 Return-Path: Delivered-To: svn-src-head@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 B1AF8105BE50; Sat, 28 Jul 2018 01:00:00 +0000 (UTC) (envelope-from cem@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 66209716DD; Sat, 28 Jul 2018 01:00:00 +0000 (UTC) (envelope-from cem@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 443031F66B; Sat, 28 Jul 2018 01:00:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6S100x0016889; Sat, 28 Jul 2018 01:00:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6S100Gp016888; Sat, 28 Jul 2018 01:00:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201807280100.w6S100Gp016888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 28 Jul 2018 01:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336801 - head/contrib/libarchive/libarchive X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/libarchive/libarchive X-SVN-Commit-Revision: 336801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2018 01:00:00 -0000 Author: cem Date: Sat Jul 28 00:59:59 2018 New Revision: 336801 URL: https://svnweb.freebsd.org/changeset/base/336801 Log: MFV r336800: libarchive: Cherry-pick upstream 2c8c83b9 Relevant vendor changes: Fix issue #948: out-of-bounds read in lha_read_data_none() admbugs: 877 MFC after: 3 days Security: CVE-2017-14503 Modified: head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_lha.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sat Jul 28 00:55:57 2018 (r336800) +++ head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sat Jul 28 00:59:59 2018 (r336801) @@ -701,6 +701,12 @@ archive_read_format_lha_read_header(struct archive_rea * Prepare variables used to read a file content. */ lha->entry_bytes_remaining = lha->compsize; + if (lha->entry_bytes_remaining < 0) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Invalid LHa entry size"); + return (ARCHIVE_FATAL); + } lha->entry_offset = 0; lha->entry_crc_calculated = 0;