[doxygen] Fix crash on unclosed HTML tag

Fixes #1935
This commit is contained in:
Olly Betts 2022-01-26 15:12:21 +13:00
commit 0a7192ce8b
4 changed files with 15 additions and 1 deletions

View file

@ -1241,6 +1241,9 @@ void DoxygenParser::processHtmlTags(size_t &pos, const std::string &line) {
// prepend '<' to distinguish HTML tags from doxygen commands
if (!cmd.empty() && addDoxyCommand(m_tokenList, '<' + cmd)) {
// it is a valid HTML command
if (pos == string::npos) {
pos = line.size();
}
if (line[pos] != '>') {
// it should be HTML tag with args,
// for example <A ...>, <IMG ...>, ...
@ -1266,7 +1269,7 @@ void DoxygenParser::processHtmlTags(size_t &pos, const std::string &line) {
}
}
if (pos != string::npos) {
if (pos < line.size()) {
pos++; // skip '>'
}
} else {