From cb758be9a99d13cfa903432fae0864a1656e2c49 Mon Sep 17 00:00:00 2001 From: LN Liberda Date: Thu, 7 May 2026 09:45:32 +0200 Subject: [PATCH] unbundle/minizip: Ignore Unicode Path Extra Field The fields come from chromium's patches on minizip --- third_party/zlib/google/zip_reader.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/third_party/zlib/google/zip_reader.cc b/third_party/zlib/google/zip_reader.cc index 002a1e3ed01d3..88f075ec7739a 100644 --- a/third_party/zlib/google/zip_reader.cc +++ b/third_party/zlib/google/zip_reader.cc @@ -318,27 +318,6 @@ // Directory path is about to be overridden. Decode and normalize it now into // `entry_.physical_path` so consumers (e.g. Safe Browsing) can still see the // name that other tools (e.g. Windows Explorer) would use for extraction. - if (info.size_utf8_filename > 0) { - std::u16string physical_path_in_utf16; - if (!base::CodepageToUTF16(entry_.path_in_original_encoding, - configured_encoding, - base::OnStringConversionError::SUBSTITUTE, - &physical_path_in_utf16)) { - LOG(ERROR) << "Cannot convert path from encoding " << configured_encoding; - return false; - } - // Normalize() stores the normalized result in entry_.path; copy it before - // applying the Unicode Path Extra Field below. - Normalize(physical_path_in_utf16); - entry_.physical_path = entry_.path; - physical_path_is_directory = entry_.is_directory; - physical_path_is_unsafe = entry_.is_unsafe; - - // Use the Info-ZIP Unicode Path Extra Field if present. - DCHECK(info.utf8_filename[info.size_utf8_filename] == '\0'); - entry_.path_in_original_encoding = info.utf8_filename; - entry_path_encoding = base::kCodepageUTF8; - } // Convert path from original encoding to Unicode. std::u16string path_in_utf16; @@ -353,17 +332,9 @@ // Normalize path. Normalize(path_in_utf16); - if (info.size_utf8_filename > 0) { - // Treat an entry as a directory only if both names are directories; - // otherwise callers that analyze file entries should inspect it as a file. - entry_.is_directory = entry_.is_directory && physical_path_is_directory; - // Treat an entry as unsafe if either name is unsafe. - entry_.is_unsafe = entry_.is_unsafe || physical_path_is_unsafe; - } else { // In the common case (no Unicode Path Extra Field) the physical path // matches the effective path. entry_.physical_path = entry_.path; - } entry_.original_size = info.uncompressed_size;