From a672428232cffea7931a692504bfb4b0f8c12fbb Mon Sep 17 00:00:00 2001 From: PabloMK7 Date: Thu, 16 May 2024 00:30:18 +0200 Subject: [PATCH] Artic Base: Do not use cache if the read would result in OOB --- src/core/file_sys/archive_artic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/file_sys/archive_artic.cpp b/src/core/file_sys/archive_artic.cpp index 36f395a23..f0bd658e4 100644 --- a/src/core/file_sys/archive_artic.cpp +++ b/src/core/file_sys/archive_artic.cpp @@ -383,7 +383,7 @@ ResultVal ArticFileBackend::Read(u64 offset, std::size_t length, u8 auto cache = cache_provider->ProvideCache( client, cache_provider->PathsToVector(archive_path, file_path), true); - if (cache != nullptr) { + if (cache != nullptr && (offset + static_cast(length)) < GetSize()) { return cache->Read(file_handle, offset, length, buffer); }