Skip to content

Commit

Permalink
[slang-tidy] Fix UB with unmodified stringstream input argument at Ti…
Browse files Browse the repository at this point in the history
…dyConfigParser::nextChar (#861)

Co-authored-by: Yan Churkin <yan@ispras.ru>
  • Loading branch information
likeamahoney and Yan Churkin authored Dec 19, 2023
1 parent 47a4dc9 commit 90c8753
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/tidy/src/TidyConfigParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ char TidyConfigParser::nextChar() {
char c;
do {
fileStream >> std::noskipws >> c;
if (fileStream.eof())
return 0;
} while (c == ' ' || c == '\t');
if (fileStream.eof())
return 0;
col++;
#if defined(_WIN32)
if (c == '\r' && fileStream.peek() == '\n') {
Expand Down

0 comments on commit 90c8753

Please sign in to comment.