From: Catalin Patulea Date: Fri, 22 Jul 2016 15:27:31 +0000 (-0400) Subject: ustar: fix out of bounds read on empty string ("") filename. X-Git-Tag: v3.2.2~35^2~3^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F750%2Fhead;p=thirdparty%2Flibarchive.git ustar: fix out of bounds read on empty string ("") filename. --- diff --git a/libarchive/archive_write_set_format_ustar.c b/libarchive/archive_write_set_format_ustar.c index 484ab34b2..797b5334b 100644 --- a/libarchive/archive_write_set_format_ustar.c +++ b/libarchive/archive_write_set_format_ustar.c @@ -307,7 +307,7 @@ archive_write_ustar_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);