Skip to content

Commit

Permalink
CVE-2022-0497 Out-of-bounds memory access in comment parser.
Browse files Browse the repository at this point in the history
Public issue:
#4043

Fix in master branch:
#4044
  • Loading branch information
t-paul committed Feb 5, 2022
1 parent 00a4692 commit 84addf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/comment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static std::string getComment(const std::string &fulltext, int line)
}

int end = start + 1;
while (fulltext[end] != '\n') end++;
while (end < fulltext.size() && fulltext[end] != '\n') end++;

std::string comment = fulltext.substr(start, end - start);

Expand Down

0 comments on commit 84addf3

Please sign in to comment.