mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Merge pull request #16500 from aschackmull/java/static-field-side-effect
Java: Add support for flow through side-effects on static fields.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: majorAnalysis
|
||||
---
|
||||
* Added support for data flow through side-effects on static fields. For example, when a static field containing an array is updated.
|
||||
@@ -40,8 +40,11 @@ private predicate fieldStep(Node node1, Node node2) {
|
||||
exists(Field f |
|
||||
// Taint fields through assigned values only if they're static
|
||||
f.isStatic() and
|
||||
f.getAnAssignedValue() = node1.asExpr() and
|
||||
node2.(FieldValueNode).getField() = f
|
||||
|
|
||||
f.getAnAssignedValue() = node1.asExpr()
|
||||
or
|
||||
f.getAnAccess() = node1.(PostUpdateNode).getPreUpdateNode().asExpr()
|
||||
)
|
||||
or
|
||||
exists(Field f, FieldRead fr |
|
||||
|
||||
Reference in New Issue
Block a user