From 9fb51e57e396a8722e06b25b87c913e5f6ab227b Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 27 Jul 2014 09:45:47 +0400 Subject: [PATCH] (TryOpen): check entry name validity. --- ArcFormats/ArcNPA.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ArcFormats/ArcNPA.cs b/ArcFormats/ArcNPA.cs index e6456780..0704fda3 100644 --- a/ArcFormats/ArcNPA.cs +++ b/ArcFormats/ArcNPA.cs @@ -99,6 +99,8 @@ namespace GameRes.Formats for (int i = 0; i < total_count; ++i) { int name_size = file.View.ReadInt32 (cur_offset); + if ((uint)name_size >= dir_size) + return null; int type = file.View.ReadByte (cur_offset+4+name_size); if (1 != type) // ignore directory entries {