Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Unexpected closing tag caused segfaults #112

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Kommon/Core/Initialization/KXMLTokenizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,17 @@ void KXMLTokenizer::ParseElementEndName()

//if at ">", then check and send end element, then prepare value, then ParseBody
if (AtOneOf(fRightAngle)) {
if (fNames.empty()) {
fBuffer = string("no element open but got unexpected closing tag for element <") + fBuffer +
string(">");
fError->SetValue(fBuffer);
fError->SetLine(fLine);
fError->SetColumn(fColumn);
ProcessToken(fError);
fState = fFinalState;
return;
}

if (fNames.top() != fBuffer) {
fBuffer = string("expected closing element name <") + fNames.top() + string(">, but got <") + fBuffer +
string("> instead");
Expand Down
Loading