From b7bafbef9396b91daa3de8317ea32cb10f6e62e2 Mon Sep 17 00:00:00 2001 From: Michael Votaw Date: Wed, 30 Apr 2025 10:48:35 -0500 Subject: [PATCH] Added note about checking dwi chart length of at least 2 characters --- src/NotesLoaderDWI.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/NotesLoaderDWI.cpp b/src/NotesLoaderDWI.cpp index 7589546973..d8bf9a057b 100644 --- a/src/NotesLoaderDWI.cpp +++ b/src/NotesLoaderDWI.cpp @@ -437,10 +437,12 @@ static bool LoadFromDWITokens( { CHECKPOINT_M( "DWILoader::LoadFromDWITokens()" ); + // If there's no step data to load for this chart, bail out here, instead of letting + // SetNoteData() throw an assertion. + // If the step data isn't at least 2 characters long, ParseNoteData() runs the risk + // of trying to read past the end of the string. if (sStepData1.size() < 2 && sStepData2.size() < 2) { - // If there's no step data to load for this chart, bail out here, instead of letting - // SetNoteData() throw an assertion. LOG->Warn("Song file \"%s\" has malformed chart data for chart %s:%s:%s. Skipping chart.", sPath.c_str(), sMode.c_str(), sDescription.c_str(), sNumFeet.c_str()); return false; }