From 702a49fa04080955c3116aa246f333a0364299a5 Mon Sep 17 00:00:00 2001 From: Vladimir Chistyakov Date: Mon, 5 Oct 2026 16:37:11 +0700 Subject: [PATCH] chore: add bugs to check if codeql finds them --- src/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 4ed357c..1a01cf0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,10 +1,22 @@ #include +#include +#include +#include #include #include #include #include -int main(int, char**) { +namespace { +void print_arg(const char* input) { + char* buffer = static_cast(std::malloc(std::strlen(input))); // NOLINT + std::strcpy(buffer, input); + std::puts(buffer); +} +} // namespace + +int main(int, char** argv) { + print_arg(argv[0]); // NOLINT constexpr std::array indices{3, 4, 5, 7}; constexpr auto result = std::transform_reduce( indices.cbegin(), indices.cend(), 0ULL, std::plus{}, math::fib);