From 88c263ee8e7c449ef00dc9029874ddfb3f14812f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 18 May 2019 18:49:19 -0400 Subject: [PATCH] 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. --- src/core/hle/service/am/am.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 26a665bfdb..6751a9d9d3 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) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ERR_SIZE_OUT_OF_BOUNDS); + return; } std::memcpy(backing.buffer.data() + offset, data.data(), data.size()); @@ -857,6 +858,7 @@ void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ERR_SIZE_OUT_OF_BOUNDS); + return; } ctx.WriteBuffer(backing.buffer.data() + offset, size);