svn commit: r282930 - vendor/libarchive/dist/libarchive

Xin LI delphij at FreeBSD.org
Thu May 14 21:39:04 UTC 2015


Author: delphij
Date: Thu May 14 21:39:03 2015
New Revision: 282930
URL: https://svnweb.freebsd.org/changeset/base/282930

Log:
  Apply upstream changeset 24f5de6:
  
  Set a proper error message if we hit end-of-file when
  trying to read a cpio header.
  
  Suggested by Issue #395, although the actual problem there
  seems to have been the same as Issue #394.

Modified:
  vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c

Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c	Thu May 14 21:35:45 2015	(r282929)
+++ vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c	Thu May 14 21:39:03 2015	(r282930)
@@ -864,8 +864,11 @@ header_bin_le(struct archive_read *a, st
 
 	/* Read fixed-size portion of header. */
 	h = __archive_read_ahead(a, bin_header_size, NULL);
-	if (h == NULL)
+	if (h == NULL) {
+	    archive_set_error(&a->archive, 0,
+		"End of file trying to read next cpio header");
 	    return (ARCHIVE_FATAL);
+	}
 
 	/* Parse out binary fields. */
 	header = (const unsigned char *)h;
@@ -900,8 +903,11 @@ header_bin_be(struct archive_read *a, st
 
 	/* Read fixed-size portion of header. */
 	h = __archive_read_ahead(a, bin_header_size, NULL);
-	if (h == NULL)
+	if (h == NULL) {
+	    archive_set_error(&a->archive, 0,
+		"End of file trying to read next cpio header");
 	    return (ARCHIVE_FATAL);
+	}
 
 	/* Parse out binary fields. */
 	header = (const unsigned char *)h;


More information about the svn-src-all mailing list