aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_write_set_format_gnutar.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_write_set_format_gnutar.c')
-rw-r--r--libarchive/archive_write_set_format_gnutar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libarchive/archive_write_set_format_gnutar.c b/libarchive/archive_write_set_format_gnutar.c
index 2d858c9f752c..1966c53fff14 100644
--- a/libarchive/archive_write_set_format_gnutar.c
+++ b/libarchive/archive_write_set_format_gnutar.c
@@ -339,7 +339,7 @@ archive_write_gnutar_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);