Skip to content

Commit da403c1

Browse files
authored
Merge pull request github#14039 from jketema/non-constant-assign
C++: Omit assign case from `cpp/non-constant-format`
2 parents 6c664e9 + 45c56fb commit da403c1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ predicate isNonConst(DataFlow::Node node, boolean isIndirect) {
105105
or
106106
e instanceof NewArrayExpr
107107
or
108-
e instanceof AssignExpr
109-
or
110108
exists(Variable v | v = e.(VariableAccess).getTarget() |
111109
v.getType().(ArrayType).getBaseType() instanceof CharType and
112110
exists(AssignExpr ae |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The `cpp/non-constant-format` query no longer considers an assignment on the right-hand side of another assignment to be a source of non-constant format strings. As a result, the query may now produce fewer results.

0 commit comments

Comments
 (0)