From 2c4cfadb2fa39ae712e6b2d58e13bba028d7a9aa Mon Sep 17 00:00:00 2001 From: Dieter Baron Date: Fri, 2 Aug 2024 20:11:17 +0200 Subject: [PATCH] =?UTF-8?q?Local=20headers=20don=E2=80=99t=20contain=20fil?= =?UTF-8?q?e=20comments.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/zip_dirent.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/zip_dirent.c b/lib/zip_dirent.c index 483d8bada..f5f23cb3a 100644 --- a/lib/zip_dirent.c +++ b/lib/zip_dirent.c @@ -515,14 +515,16 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo return -1; } zde->filename = utf8_string; - if ((utf8_string = _zip_dirent_process_ef_utf_8(zde, ZIP_EF_UTF_8_COMMENT, zde->comment, check_consistency)) == NULL && zde->comment != NULL) { - zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_UTF8_COMMENT_MISMATCH); - if (!from_buffer) { - _zip_buffer_free(buffer); + if (!local) { + if ((utf8_string = _zip_dirent_process_ef_utf_8(zde, ZIP_EF_UTF_8_COMMENT, zde->comment, check_consistency)) == NULL && zde->comment != NULL) { + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_UTF8_COMMENT_MISMATCH); + if (!from_buffer) { + _zip_buffer_free(buffer); + } + return -1; } - return -1; + zde->comment = utf8_string; } - zde->comment = utf8_string; /* Zip64 */