Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #12489 FN bufferAccessOutOfBounds with overlong strcat() parameter (regression) #7268

Merged
merged 5 commits into from
Jan 28, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update testbufferoverrun.cpp
  • Loading branch information
chrchr-github authored Jan 28, 2025
commit 4399ab532335b5ffeb8a93350fc776736b5bcb7b
7 changes: 7 additions & 0 deletions test/testbufferoverrun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3151,6 +3151,13 @@ class TestBufferOverrun : public TestFixture {
" strcat(n, \"def\");\n"
"}");
TODO_ASSERT_EQUALS("[test.cpp:5]: (error) Buffer is accessed out of bounds: n\n", "", errout_str());

check("void f()\n" // 12489
"{\n"
" char d[3];\n"
" strcat(d, \"12345678\");\n"
"}");
ASSERT_EQUALS("[test.cpp:4]: (error) Buffer is accessed out of bounds: d\n", errout_str());
}

void buffer_overrun_7() {
Expand Down