From 1dc94152c3cedbabfddb7f5f48f1897529aaba95 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 3 Oct 2024 14:44:22 -0500 Subject: [PATCH] Fix array reference GC strings are 22 bytes long, but GBA strings are 10 & 7 bytes long. If a 7-char OT name is generated in C/XD and transferred, it would try iterating to the 8th char which is OOB for dest. Iterate over the smaller array, which is always dest (in this method). --- PKHeX.Core/PKM/Strings/StringConverter3GC.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKHeX.Core/PKM/Strings/StringConverter3GC.cs b/PKHeX.Core/PKM/Strings/StringConverter3GC.cs index 66282c9e2..707fb8f7e 100644 --- a/PKHeX.Core/PKM/Strings/StringConverter3GC.cs +++ b/PKHeX.Core/PKM/Strings/StringConverter3GC.cs @@ -132,7 +132,7 @@ public static class StringConverter3GC var table = jpn ? CharTableJPN : CharTableINT; int i = 0; - for (; i < data.Length; i++) + for (; i < dest.Length; i++) { var c = (char)ReadUInt16BigEndian(data[(i * 2)..]); if (c == TerminatorBigEndian)