Merge pull request #2683 from CookiePLMonster/fix-is-valid-psexe-header

Fixup IsValidPSExeHeader
This commit is contained in:
Connor McLaughlin 2021-10-29 13:17:35 +10:00 committed by GitHub
commit 6bb7672168
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -246,7 +246,7 @@ bool IsValidPSExeHeader(const PSEXEHeader& header, u32 file_size)
if (std::memcmp(header.id, expected_id, sizeof(expected_id)) != 0)
return false;
if (header.file_size > (sizeof(PSEXEHeader) + file_size))
if ((header.file_size + sizeof(PSEXEHeader)) > file_size)
return false;
return true;