From owner-svn-src-stable-9@freebsd.org Tue Feb 23 08:12:40 2016 Return-Path: Delivered-To: svn-src-stable-9@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 C0499AB150E; Tue, 23 Feb 2016 08:12:40 +0000 (UTC) (envelope-from delphij@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 901261DAD; Tue, 23 Feb 2016 08:12:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1N8CdSv001458; Tue, 23 Feb 2016 08:12:39 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1N8Cdqx001457; Tue, 23 Feb 2016 08:12:39 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201602230812.u1N8Cdqx001457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 23 Feb 2016 08:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r295915 - stable/9/contrib/libarchive/libarchive X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2016 08:12:40 -0000 Author: delphij Date: Tue Feb 23 08:12:39 2016 New Revision: 295915 URL: https://svnweb.freebsd.org/changeset/base/295915 Log: Instant-MFC r295914: MFV r295913: Partially apply upstream changeset 6e06b1c8 (kientzle). Limit filter recursion level to 25 (instead of infinite). This fixes a potential crash issue discovered by Alexander Cherepanov. PR: 207362 Reported by: Robert Clausecker Obtained from: libarchive github project Approved by: so Modified: stable/9/contrib/libarchive/libarchive/archive_read.c Directory Properties: stable/9/contrib/libarchive/ (props changed) stable/9/contrib/libarchive/libarchive/ (props changed) Modified: stable/9/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- stable/9/contrib/libarchive/libarchive/archive_read.c Tue Feb 23 07:13:22 2016 (r295914) +++ stable/9/contrib/libarchive/libarchive/archive_read.c Tue Feb 23 08:12:39 2016 (r295915) @@ -352,13 +352,13 @@ archive_read_open2(struct archive *_a, v static int build_stream(struct archive_read *a) { - int number_bidders, i, bid, best_bid; + int number_bidders, i, bid, best_bid, n; struct archive_read_filter_bidder *bidder, *best_bidder; struct archive_read_filter *filter; ssize_t avail; int r; - for (;;) { + for (n = 0; n < 25; ++n) { number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]); best_bid = 0; @@ -402,6 +402,9 @@ build_stream(struct archive_read *a) return (r); } } + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Input requires too many filters for decoding"); + return (ARCHIVE_FATAL); } /*