From 1f7e1e9f50f9ecb0a184de5496b7f94401a92433 Mon Sep 17 00:00:00 2001 From: morkt Date: Fri, 20 Nov 2015 17:47:02 +0400 Subject: [PATCH] (IntOpener.DecipherName): check for array bounds. --- ArcFormats/CatSystem/ArcINT.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArcFormats/CatSystem/ArcINT.cs b/ArcFormats/CatSystem/ArcINT.cs index c8c68429..d80d553b 100644 --- a/ArcFormats/CatSystem/ArcINT.cs +++ b/ArcFormats/CatSystem/ArcINT.cs @@ -214,7 +214,7 @@ namespace GameRes.Formats.CatSystem string alphabet = "zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA"; int k = (byte)((key >> 24) + (key >> 16) + (key >> 8) + key); int i; - for (i = 0; name[i] != 0; ++i) + for (i = 0; i < name.Length && name[i] != 0; ++i) { int j = alphabet.IndexOf ((char)name[i]); if (j != -1)