From 2b8395148ff378e52a5e00c0d2ac0123258b759b Mon Sep 17 00:00:00 2001 From: kientzle Date: Sun, 30 Dec 2007 04:58:22 +0000 Subject: Update libarchive to 2.4.10. This includes a number of improvements that I've been working on but put off committing until after the RELENG_7 branch, including: * New manpages: cpio.5 mtree.5 * New archive_entry_strmode() * New archive_entry_link_resolver() * New read support: mtree format * Internal API change: read format auction only runs once * Running the auction only once allowed simplifying a lot of bid logic. * Cpio robustness: search for next header after a sync error * Support device nodes on ISO9660 images * Eliminate a lot of unnecessary copies for uncompressed archives * Corrected handling of new GNU --sparse --posix formats * Correctly handle a zero-byte write to a compressed archive * Fixed memory leaks Many of these improvements were motivated by the upcoming bsdcpio front-end. There have also been extensive improvements to the libarchive_test test harness, which I'll commit separately. --- lib/libarchive/archive_write_set_format_ustar.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/libarchive/archive_write_set_format_ustar.c') diff --git a/lib/libarchive/archive_write_set_format_ustar.c b/lib/libarchive/archive_write_set_format_ustar.c index 390b1a0..43b6543 100644 --- a/lib/libarchive/archive_write_set_format_ustar.c +++ b/lib/libarchive/archive_write_set_format_ustar.c @@ -216,12 +216,15 @@ archive_write_ustar_header(struct archive_write *a, struct archive_entry *entry) p = archive_entry_pathname(entry); if (p[strlen(p) - 1] != '/') { t = (char *)malloc(strlen(p) + 2); - if (t != NULL) { - strcpy(t, p); - strcat(t, "/"); - archive_entry_copy_pathname(entry, t); - free(t); + if (t == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate ustar data"); + return(ARCHIVE_FATAL); } + strcpy(t, p); + strcat(t, "/"); + archive_entry_copy_pathname(entry, t); + free(t); } } -- cgit v1.1