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
  • Loading branch information
Yan Churkin committed Dec 19, 2023
1 parent 47a4dc9 commit 42f2a61
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 42f2a61

Please sign in to comment.