aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_write_set_format_pax.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_write_set_format_pax.c')
-rw-r--r--libarchive/archive_write_set_format_pax.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libarchive/archive_write_set_format_pax.c b/libarchive/archive_write_set_format_pax.c
index 3cebeae187dc..6f78c48bd651 100644
--- a/libarchive/archive_write_set_format_pax.c
+++ b/libarchive/archive_write_set_format_pax.c
@@ -660,7 +660,7 @@ archive_write_pax_header(struct archive_write *a,
* 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);