OSDN Git Service

#39661 [Dridi's PATCH 5/9] Avoid array overflow of the CSV header
authoryyagi <yyagi.dtxmania@gmail.com>
Mon, 7 Oct 2019 14:11:32 +0000 (23:11 +0900)
committeryyagi <yyagi.dtxmania@gmail.com>
Mon, 7 Oct 2019 14:11:32 +0000 (23:11 +0900)
DTXMania/コード/全体/CResources.cs

index 89d7187..5d278fd 100644 (file)
@@ -292,7 +292,7 @@ namespace DTXMania
                                        }
                                        else
                                        {
-                                               for ( int i = 0; i < fields.GetLength( 0 ); i++ )
+                                               for (int i = 0; i < Math.Min(fields.Length, csvHeader.Length); i++)
                                                {
                                                        string key = strItemName + "." + csvHeader[ i ];
                                                        string value = fields[ i ];