FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge pull request #14021 from jketema/non-const-format-test · github/codeql@cf53956 · GitHub

/ codeql Public

Commit cf53956

Browse files
authored
Merge pull request #14021 from jketema/non-const-format-test
C++: Add `cpp/non-constant-format` test
2 parents 5734e47 + 6566b91 commit cf53956

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • cpp/ql/test/query-tests/Likely Bugs/Format/NonConstantFormat

‎cpp/ql/test/query-tests/Likely Bugs/Format/NonConstantFormat/test.cpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,10 @@ void fmt_via_strcpy(char *data) {
156156
strcpy(data, "some string");
157157
printf(data); // BAD
158158
}
159+
160+
void fmt_with_assignment() {
161+
const char *x, *y;
162+
163+
x = y = "a";
164+
printf(y); // GOOD
165+
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL