(PK): filename sanity check.

This commit is contained in:
morkt 2018-10-07 08:53:52 +04:00
parent b76aa6588f
commit bf94ae9a62

View File

@ -67,7 +67,7 @@ namespace GameRes.Formats.Banana // namespace is arbitrary, actual format source
for (int j = 0; j < name_length; ++j)
{
name_buffer[j] -= key--;
if (name_buffer[j] < 0x20)
if (name_buffer[j] < 0x20 || name_buffer[j] >= 0xFD)
return null;
}
string name = Encodings.cp932.GetString (name_buffer, 0, name_length);