diff options
Diffstat (limited to 'libarchive/archive_write_set_format_ar.c')
-rw-r--r-- | libarchive/archive_write_set_format_ar.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libarchive/archive_write_set_format_ar.c b/libarchive/archive_write_set_format_ar.c index 956b932..9f17564 100644 --- a/libarchive/archive_write_set_format_ar.c +++ b/libarchive/archive_write_set_format_ar.c @@ -165,7 +165,7 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry) * Reject files with empty name. */ pathname = archive_entry_pathname(entry); - if (*pathname == '\0') { + if (pathname == NULL || *pathname == '\0') { archive_set_error(&a->archive, EINVAL, "Invalid filename"); return (ARCHIVE_WARN); @@ -366,7 +366,7 @@ archive_write_ar_data(struct archive_write *a, const void *buff, size_t s) ar = (struct ar_w *)a->format_data; if (s > ar->entry_bytes_remaining) - s = ar->entry_bytes_remaining; + s = (size_t)ar->entry_bytes_remaining; if (ar->is_strtab > 0) { if (ar->has_strtab > 0) { |