mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
Fix crash loading some kind of .zip extensions w/filename w/Unicode chars
This commit is contained in:
parent
9a06deb0e6
commit
c0d4264789
@ -858,7 +858,15 @@ ExtensionInfo Extensions::getCompressedExtensionInfo(const std::string& zipFn)
|
||||
ReadArchive in(zipFn);
|
||||
archive_entry* entry;
|
||||
while ((entry = in.readEntry()) != nullptr) {
|
||||
const std::string entryFn = archive_entry_pathname(entry);
|
||||
const char* entryFnPtr = archive_entry_pathname(entry);
|
||||
|
||||
// This can happen, e.g. if the file contains "!" + unicode chars
|
||||
// (maybe a bug in archive library?)
|
||||
// TODO try to find the real cause of this on libarchive
|
||||
if (!entryFnPtr)
|
||||
continue;
|
||||
|
||||
const std::string entryFn = entryFnPtr;
|
||||
if (base::get_file_name(entryFn) != kPackageJson)
|
||||
continue;
|
||||
|
||||
@ -895,8 +903,12 @@ Extension* Extensions::installCompressedExtension(const std::string& zipFn,
|
||||
|
||||
archive_entry* entry;
|
||||
while ((entry = in.readEntry()) != nullptr) {
|
||||
const char* entryFnPtr = archive_entry_pathname(entry);
|
||||
if (!entryFnPtr)
|
||||
continue;
|
||||
|
||||
// Fix the entry filename to write the file in the disk
|
||||
std::string fn = archive_entry_pathname(entry);
|
||||
std::string fn = entryFnPtr;
|
||||
|
||||
LOG("EXT: Original filename in zip <%s>...\n", fn.c_str());
|
||||
|
||||
|
2
third_party/libarchive
vendored
2
third_party/libarchive
vendored
@ -1 +1 @@
|
||||
Subproject commit e1309af03a4bcea2f0f0bb1f48530f2b794cc8b2
|
||||
Subproject commit 1ac8fae3220569877203ae607d20262f71f48360
|
Loading…
Reference in New Issue
Block a user