aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_write_set_format_v7tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_write_set_format_v7tar.c')
-rw-r--r--libarchive/archive_write_set_format_v7tar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libarchive/archive_write_set_format_v7tar.c b/libarchive/archive_write_set_format_v7tar.c
index 62b15229444c..53c0db0e2041 100644
--- a/libarchive/archive_write_set_format_v7tar.c
+++ b/libarchive/archive_write_set_format_v7tar.c
@@ -284,7 +284,7 @@ archive_write_v7tar_header(struct archive_write *a, struct archive_entry *entry)
* case getting WCS failed. On POSIX, this is a
* normal operation.
*/
- if (p != NULL && p[strlen(p) - 1] != '/') {
+ if (p != NULL && p[0] != '\0' && p[strlen(p) - 1] != '/') {
struct archive_string as;
archive_string_init(&as);