Date: Fri, 30 Sep 2016 22:28:21 +0000 (UTC) From: Toomas Soome <tsoome@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306534 - head/lib/libstand Message-ID: <201609302228.u8UMSLuQ068684@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609302228.u8UMSLuQ068684>