mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-28 11:33:06 +00:00
Fix bounds check on reading the IPC buffer
This commit is contained in:
parent
456b91307a
commit
cf07af6eae
1 changed files with 4 additions and 4 deletions
|
@ -176,14 +176,14 @@ namespace Ryujinx.HLE.OsHle.Ipc
|
|||
|
||||
public (long Position, long Size) GetBufferType0x21(int Index = 0)
|
||||
{
|
||||
if (PtrBuff.Count != 0 &&
|
||||
if (PtrBuff.Count > Index &&
|
||||
PtrBuff[Index].Position != 0 &&
|
||||
PtrBuff[Index].Size != 0)
|
||||
{
|
||||
return (PtrBuff[Index].Position, PtrBuff[Index].Size);
|
||||
}
|
||||
|
||||
if (SendBuff.Count != 0 &&
|
||||
if (SendBuff.Count > Index &&
|
||||
SendBuff[Index].Position != 0 &&
|
||||
SendBuff[Index].Size != 0)
|
||||
{
|
||||
|
@ -195,14 +195,14 @@ namespace Ryujinx.HLE.OsHle.Ipc
|
|||
|
||||
public (long Position, long Size) GetBufferType0x22(int Index = 0)
|
||||
{
|
||||
if (RecvListBuff.Count != 0 &&
|
||||
if (RecvListBuff.Count > Index &&
|
||||
RecvListBuff[Index].Position != 0 &&
|
||||
RecvListBuff[Index].Size != 0)
|
||||
{
|
||||
return (RecvListBuff[Index].Position, RecvListBuff[Index].Size);
|
||||
}
|
||||
|
||||
if (ReceiveBuff.Count != 0 &&
|
||||
if (ReceiveBuff.Count > Index &&
|
||||
ReceiveBuff[Index].Position != 0 &&
|
||||
ReceiveBuff[Index].Size != 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue