Skip to content

C++: Add cpp/non-constant-format test#14021

Merged
jketema merged 2 commits intogithub:mainfrom
jketema:non-const-format-test
Aug 22, 2023
Merged

C++: Add cpp/non-constant-format test#14021
jketema merged 2 commits intogithub:mainfrom
jketema:non-const-format-test

Conversation

@jketema
Copy link
Copy Markdown
Contributor

@jketema jketema commented Aug 22, 2023

No description provided.

@jketema jketema requested a review from a team as a code owner August 22, 2023 14:24
@github-actions github-actions bot added the C++ label Aug 22, 2023
MathiasVP
MathiasVP previously approved these changes Aug 22, 2023
@jketema
Copy link
Copy Markdown
Contributor Author

jketema commented Aug 22, 2023

This change adds a safer function to demonstrate proper usage of formatted strings in C++ and avoid buffer overflows and vulnerabilities.

  • cpp/ql/test/query-tests/Likely Bugs/Format/NonConstantFormat/test.cpp: Added a safer function fmt_with_assignment() to demonstrate proper usage of formatted strings in C++ and avoid buffer overflows and vulnerabilities. (cpp/ql/test/query-tests/Likely Bugs/Format/NonConstantFormat/test.cppR159-R165)

@jketema jketema merged commit cf53956 into github:main Aug 22, 2023
@jketema jketema deleted the non-const-format-test branch August 22, 2023 15:38
@jketema
Copy link
Copy Markdown
Contributor Author

jketema commented Aug 22, 2023

Note to anyone who might read the previous comment later. This was an attempt at an autogenerated summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants