Skip to content
Draft

test #7764

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@

std::string toString(Color c)
{

std::string st;
st[0] = 'x';

Check failure

Code scanning / CppCheck

Out of bounds access in expression 'st[0]' because 'st' is empty. Critical

Out of bounds access in expression 'st[0]' because 'st' is empty.

Check warning

Code scanning / CppCheck

Variable 'st[0]' is assigned a value that is never used. Warning

Variable 'st[0]' is assigned a value that is never used.

std::ostringstream ss;
ss << c;
return ss.str();
Expand Down
3 changes: 3 additions & 0 deletions lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,9 @@

mLogger->resetExitCode();

std::string str;
str[0] = 'x';

Check failure

Code scanning / CppCheck

Out of bounds access in expression 'st[0]' because 'st' is empty. Critical

Out of bounds access in expression 'str[0]' because 'str' is empty.

if (Settings::terminated())
return mLogger->exitcode();

Expand Down
Loading