From bc01db0c149dbbaa5a43d19cef8439b0ff2e15f1 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 21 Aug 2026 08:50:03 +0200 Subject: [PATCH] Name the test's locals so Flawfinder stops matching them The code scanning job reports CWE-362 - "check when opening files" - for a test that opens no files: Flawfinder matched a local variable called open. Rename it and its partner. Signed-off-by: Niels Lohmann --- tests/src/unit-diagnostic-positions.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/src/unit-diagnostic-positions.cpp b/tests/src/unit-diagnostic-positions.cpp index a9a595245..9398b6648 100644 --- a/tests/src/unit-diagnostic-positions.cpp +++ b/tests/src/unit-diagnostic-positions.cpp @@ -79,18 +79,18 @@ TEST_CASE("Better diagnostics with positions") CAPTURE(depth) CAPTURE(objects) - const std::string open = objects ? R"({"a":)" : "["; - const std::string close = objects ? "}" : "]"; + const std::string opening = objects ? R"({"a":)" : "["; + const std::string closing = objects ? "}" : "]"; std::string text; for (std::size_t i = 0; i < depth; ++i) { - text += open; + text += opening; } text += "12"; for (std::size_t i = 0; i < depth; ++i) { - text += close; + text += closing; } const json original = json::parse(text);