dtxmania 中文
Revision | 26152d9e163377318c84d4d37896a07f10378aad (tree) |
---|---|
Zeit | 2019-10-07 23:11:32 |
Autor | yyagi <yyagi.dtxmania@gmai...> |
Commiter | yyagi |
#39661 [Dridi's PATCH 5/9] Avoid array overflow of the CSV header
@@ -292,7 +292,7 @@ namespace DTXMania | ||
292 | 292 | } |
293 | 293 | else |
294 | 294 | { |
295 | - for ( int i = 0; i < fields.GetLength( 0 ); i++ ) | |
295 | + for (int i = 0; i < Math.Min(fields.Length, csvHeader.Length); i++) | |
296 | 296 | { |
297 | 297 | string key = strItemName + "." + csvHeader[ i ]; |
298 | 298 | string value = fields[ i ]; |