From 64e3e9ffaaf13c6f08901225b6e3312f6b18b217 Mon Sep 17 00:00:00 2001 From: PabloMK7 Date: Thu, 16 May 2024 00:30:18 +0200 Subject: [PATCH] Do not use the cache if the read would result in OOB (#130) --- 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); }