File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -422,10 +422,11 @@ class Zip::Impl final {
422
422
423
423
// make sure zip files like root/../../file.txt don't get extracted to
424
424
// avoid zip attacks
425
+ std::error_code ec;
425
426
#ifdef GEODE_IS_WINDOWS
426
- if (!std::filesystem::relative ((dir / filePath).wstring (), dir.wstring ()).empty ()) {
427
+ if (!std::filesystem::relative ((dir / filePath).wstring (), dir.wstring (), ec ).empty ()) {
427
428
#else
428
- if (!std::filesystem::relative (dir / filePath, dir).empty ()) {
429
+ if (!std::filesystem::relative (dir / filePath, dir, ec ).empty ()) {
429
430
#endif
430
431
if (m_entries.at (filePath).isDirectory ) {
431
432
GEODE_UNWRAP (file::createDirectoryAll (dir / filePath));
@@ -442,6 +443,10 @@ class Zip::Impl final {
442
443
" Zip entry '{}' is not contained within zip bounds" ,
443
444
dir / filePath
444
445
);
446
+
447
+ if (ec) {
448
+ return Err (fmt::format (" Unable to check relative: {}" , ec.message ()));
449
+ }
445
450
}
446
451
} while (mz_zip_goto_next_entry (m_handle) == MZ_OK);
447
452
You can’t perform that action at this time.
0 commit comments