Date: Thu, 14 May 2015 21:39:04 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r282930 - vendor/libarchive/dist/libarchive Message-ID: <201505142139.t4ELd4hf069097@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505142139.t4ELd4hf069097>