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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to