summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@gmail.com>2011-02-11 01:46:54 -0500
committerTim Kientzle <kientzle@gmail.com>2011-02-11 01:46:54 -0500
commit465bb5e51bdd609c95e802b43625c5911b1ee500 (patch)
tree2cf6c40262bb96fb3184d9bb9dad6f40a1e33b5f
parent6ac2c3211400d36682690fc5f83e9a83faf81b20 (diff)
downloadlibarchive-465bb5e51bdd609c95e802b43625c5911b1ee500.tar.gz
If no name is available, don't store one.
SVN-Revision: 2961
-rw-r--r--libarchive/archive_write_set_format_ustar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libarchive/archive_write_set_format_ustar.c b/libarchive/archive_write_set_format_ustar.c
index f17aa3ae..58e68fa7 100644
--- a/libarchive/archive_write_set_format_ustar.c
+++ b/libarchive/archive_write_set_format_ustar.c
@@ -279,7 +279,9 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512],
*/
pp = archive_entry_pathname(entry);
- if (strlen(pp) <= USTAR_name_size)
+ if (pp == NULL) {
+ /* Yuck. */
+ } else if (strlen(pp) <= USTAR_name_size)
memcpy(h + USTAR_name_offset, pp, strlen(pp));
else {
/* Store in two pieces, splitting at a '/'. */