mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 12:05:23 +00:00
Fix games passing invalid npids
This commit is contained in:
parent
7504503d5f
commit
067ea68979
1 changed files with 12 additions and 0 deletions
|
@ -1413,6 +1413,13 @@ namespace rpcn
|
|||
std::vector<flatbuffers::Offset<flatbuffers::String>> davec;
|
||||
for (u32 i = 0; i < req->allowedUserNum; i++)
|
||||
{
|
||||
// Some games just give us garbage, make sure npid is valid before passing
|
||||
// Ex: Aquapazza (gives uninitialized buffer on the stack and allowedUserNum is hardcoded to 100)
|
||||
if (!np::is_valid_npid(req->allowedUser[i]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
auto bin = builder.CreateString(req->allowedUser[i].handle.data);
|
||||
davec.push_back(bin);
|
||||
}
|
||||
|
@ -1424,6 +1431,11 @@ namespace rpcn
|
|||
std::vector<flatbuffers::Offset<flatbuffers::String>> davec;
|
||||
for (u32 i = 0; i < req->blockedUserNum; i++)
|
||||
{
|
||||
if (!np::is_valid_npid(req->blockedUser[i]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
auto bin = builder.CreateString(req->blockedUser[i].handle.data);
|
||||
davec.push_back(bin);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue