From d05bcef54852d237986313c1ad145e26be46443e Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 10 Sep 2016 15:08:44 +0400 Subject: [PATCH] (PkOpener): sanity check. --- ArcFormats/UMeSoft/ArcPK.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ArcFormats/UMeSoft/ArcPK.cs b/ArcFormats/UMeSoft/ArcPK.cs index e7009bcf..b9b8854c 100644 --- a/ArcFormats/UMeSoft/ArcPK.cs +++ b/ArcFormats/UMeSoft/ArcPK.cs @@ -65,6 +65,8 @@ namespace GameRes.Formats.UMeSoft if (name_len+14 > index_end-index_offset) return null; string name = file.View.ReadString (index_offset, name_len); + if (name.Length < (int)name_len / 2 + 1) + return null; index_offset += name_len+6; var entry = FormatCatalog.Instance.Create (name); entry.Size = file.View.ReadUInt32 (index_offset);