From 1e8daff02a77c75b2b84264b3021708d8025368b Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Aug 2023 16:23:47 +0200 Subject: [PATCH] C++: Add `cpp/non-constant-format` test --- .../Likely Bugs/Format/NonConstantFormat/test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpp/ql/test/query-tests/Likely Bugs/Format/NonConstantFormat/test.cpp b/cpp/ql/test/query-tests/Likely Bugs/Format/NonConstantFormat/test.cpp index f42d6835aa7..b864336699d 100644 --- a/cpp/ql/test/query-tests/Likely Bugs/Format/NonConstantFormat/test.cpp +++ b/cpp/ql/test/query-tests/Likely Bugs/Format/NonConstantFormat/test.cpp @@ -156,3 +156,10 @@ void fmt_via_strcpy(char *data) { strcpy(data, "some string"); printf(data); // BAD } + +void fmt_with_assignment() { + const char *x, *y; + + x = y = "a"; + printf(y); +}