Skip to content

Commit

Permalink
StringVar: add safety to parsing string pic delimiters
Browse files Browse the repository at this point in the history
  • Loading branch information
enewey committed Jul 12, 2023
1 parent 9d3d368 commit 8627ee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4292,10 +4292,10 @@ bool Game_Interpreter::CommandManiacShowStringPicture(lcf::rpg::EventCommand con
// for the displayed string, the id argument is in com.parameters[22]
// here we are capturing all the delimiters, but currently only need to support reading the first one
int i = 0;
int delims[3] = {};
std::vector<int> delims;
auto components = Utils::Tokenize(com.string, [p = &delims, &i](char32_t ch) {
if (ch == '\x01' || ch == '\x02' || ch == '\x03') {
(*p)[i++] = static_cast<int>(ch);
p->push_back(static_cast<int>(ch));
return true;
}
return false;
Expand Down

0 comments on commit 8627ee2

Please sign in to comment.