diff options
| author | 2019-05-18 18:49:19 -0400 | |
|---|---|---|
| committer | 2019-05-18 18:50:04 -0400 | |
| commit | 88c263ee8e7c449ef00dc9029874ddfb3f14812f (patch) | |
| tree | ac3403e5c4f26b6df92d9c8983493053a8dfd60e /src | |
| parent | Merge pull request #2462 from lioncash/video-mm (diff) | |
| download | yuzu-88c263ee8e7c449ef00dc9029874ddfb3f14812f.tar.gz yuzu-88c263ee8e7c449ef00dc9029874ddfb3f14812f.tar.xz yuzu-88c263ee8e7c449ef00dc9029874ddfb3f14812f.zip | |
service/am: Add missing return in error case for IStorageAccessor's Read()/Write().
Previously this would fall through and return successfully, despite
being an out of bounds read or write.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 26a665bfd..6751a9d9d 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -835,6 +835,7 @@ void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) { | |||
| 835 | 835 | ||
| 836 | IPC::ResponseBuilder rb{ctx, 2}; | 836 | IPC::ResponseBuilder rb{ctx, 2}; |
| 837 | rb.Push(ERR_SIZE_OUT_OF_BOUNDS); | 837 | rb.Push(ERR_SIZE_OUT_OF_BOUNDS); |
| 838 | return; | ||
| 838 | } | 839 | } |
| 839 | 840 | ||
| 840 | std::memcpy(backing.buffer.data() + offset, data.data(), data.size()); | 841 | std::memcpy(backing.buffer.data() + offset, data.data(), data.size()); |
| @@ -857,6 +858,7 @@ void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) { | |||
| 857 | 858 | ||
| 858 | IPC::ResponseBuilder rb{ctx, 2}; | 859 | IPC::ResponseBuilder rb{ctx, 2}; |
| 859 | rb.Push(ERR_SIZE_OUT_OF_BOUNDS); | 860 | rb.Push(ERR_SIZE_OUT_OF_BOUNDS); |
| 861 | return; | ||
| 860 | } | 862 | } |
| 861 | 863 | ||
| 862 | ctx.WriteBuffer(backing.buffer.data() + offset, size); | 864 | ctx.WriteBuffer(backing.buffer.data() + offset, size); |