Skip to content

Commit

Permalink
Fix, suppress
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Feb 28, 2024
1 parent 33908d3 commit 8781295
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/cfg/std.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,22 +534,23 @@ void bufferAccessOutOfBounds_std_ofstream_write(std::ofstream &os, const char* s
(void)os.write(s,n);
}

void arrayIndexOutOfBounds_std_ifstream_get(std::ifstream& in, std::streambuf& sb)
void bufferAccessOutOfBounds_std_ifstream_get(std::ifstream& in, std::streambuf& sb)
{
char cBuf[10];
// cppcheck-suppress arrayIndexOutOfBounds
// cppcheck-suppress bufferAccessOutOfBounds
in.getline(cBuf, 100);
// cppcheck-suppress arrayIndexOutOfBounds
// cppcheck-suppress bufferAccessOutOfBounds
in.read(cBuf, 100);
// cppcheck-suppress arrayIndexOutOfBounds
// cppcheck-suppress bufferAccessOutOfBounds
in.readsome(cBuf, 100);
// cppcheck-suppress arrayIndexOutOfBounds
// cppcheck-suppress bufferAccessOutOfBounds
in.get(cBuf, 100);
// cppcheck-suppress arrayIndexOutOfBounds
// cppcheck-suppress bufferAccessOutOfBounds
in.get(cBuf, 100, 'a');
// cppcheck-suppress arrayIndexOutOfBounds
// cppcheck-suppress bufferAccessOutOfBounds
in.getline(cBuf, 100, 'a');

// cppcheck-suppress constParameterReference // TODO: FP
in.get(sb, 'a');

in.close();
Expand Down

0 comments on commit 8781295

Please sign in to comment.