From owner-svn-src-head@freebsd.org Fri Sep 30 22:28:22 2016 Return-Path: Delivered-To: svn-src-head@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 278D9C04186; Fri, 30 Sep 2016 22:28:22 +0000 (UTC) (envelope-from tsoome@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 EBDCB176F; Fri, 30 Sep 2016 22:28:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8UMSLGA068685; Fri, 30 Sep 2016 22:28:21 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8UMSLuQ068684; Fri, 30 Sep 2016 22:28:21 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201609302228.u8UMSLuQ068684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 30 Sep 2016 22:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306534 - head/lib/libstand X-SVN-Group: head 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.23 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: Fri, 30 Sep 2016 22:28:22 -0000 Author: tsoome Date: Fri Sep 30 22:28:20 2016 New Revision: 306534 URL: https://svnweb.freebsd.org/changeset/base/306534 Log: cd9660_open should check for padding The libstand cd9660 reader code must check for extents having padding. Reviewed by: jhb Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D8101 Modified: head/lib/libstand/cd9660.c Modified: head/lib/libstand/cd9660.c ============================================================================== --- head/lib/libstand/cd9660.c Fri Sep 30 22:05:47 2016 (r306533) +++ head/lib/libstand/cd9660.c Fri Sep 30 22:28:20 2016 (r306534) @@ -353,7 +353,15 @@ cd9660_open(const char *path, struct ope dp = (struct iso_directory_record *) ((char *) dp + isonum_711(dp->length)); - off += isonum_711(dp->length); + + /* if the new block is zero length, its padding */ + if (isonum_711(dp->length) == 0) { + /* skip to next block, if any */ + off = boff * ISO_DEFAULT_BLOCK_SIZE; + continue; + } else { + off += isonum_711(dp->length); + } } if (off >= dsize) { rc = ENOENT;