Merge pull request #14039 from jketema/non-constant-assign

C++: Omit assign case from `cpp/non-constant-format`
This commit is contained in:
Jeroen Ketema
2023-08-24 16:54:19 +02:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -105,8 +105,6 @@ predicate isNonConst(DataFlow::Node node, boolean isIndirect) {
or
e instanceof NewArrayExpr
or
e instanceof AssignExpr
or
exists(Variable v | v = e.(VariableAccess).getTarget() |
v.getType().(ArrayType).getBaseType() instanceof CharType and
exists(AssignExpr ae |

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* 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.