1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-22 18:32:05 +00:00

fs.mitm: fix infinite loop due to off-by-one in romfs read comparison

This commit is contained in:
Michael Scire 2019-12-07 21:27:12 -08:00
parent a7e89c6dbb
commit 3c7ece2f8b

View file

@ -71,7 +71,7 @@ namespace ams::mitm::fs {
const auto &cur_source = *it;
AMS_ASSERT(offset >= cur_source.virtual_offset);
if (offset <= cur_source.virtual_offset + cur_source.size) {
if (offset < cur_source.virtual_offset + cur_source.size) {
const s64 offset_within_source = offset - cur_source.virtual_offset;
const size_t cur_read_size = std::min(size - read_so_far, size_t(cur_source.size - offset_within_source));
switch (cur_source.source_type) {