fix Zip::Impl::extractAt not making sure dest dir exists

This commit is contained in:
HJfod 2024-01-20 22:15:58 +02:00
parent cf14056037
commit 427e28c034

View file

@ -306,7 +306,8 @@ public:
mz_zip_entry_close(m_handle); mz_zip_entry_close(m_handle);
GEODE_UNWRAP(file::writeBinary(dir / name, res)); GEODE_UNWRAP(file::createDirectoryAll(dir));
GEODE_UNWRAP(file::writeBinary(dir / name, res).expect("Unable to write to {}: {error}", dir / name));
return Ok(); return Ok();
} }
@ -336,10 +337,12 @@ public:
#endif #endif
if (m_entries.at(filePath).isDirectory) { if (m_entries.at(filePath).isDirectory) {
GEODE_UNWRAP(file::createDirectoryAll(dir / filePath)); GEODE_UNWRAP(file::createDirectoryAll(dir / filePath));
} else { }
else {
GEODE_UNWRAP(this->extractAt(dir, filePath)); GEODE_UNWRAP(this->extractAt(dir, filePath));
} }
} else { }
else {
log::error( log::error(
"Zip entry '{}' is not contained within zip bounds", "Zip entry '{}' is not contained within zip bounds",
dir / filePath dir / filePath