Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Do not use the cache if the read would result in OOB
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloMK7 committed May 15, 2024
1 parent 893dad5 commit aa4b033
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/file_sys/archive_artic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ ResultVal<std::size_t> 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<u64>(length)) < GetSize()) {
return cache->Read(file_handle, offset, length, buffer);
}

Expand Down

0 comments on commit aa4b033

Please sign in to comment.