Skip to content

Commit 1dd4bf0

Browse files
Simplify StaticInitializationVectorSource
Co-authored-by: Chris Smowton <[email protected]>
1 parent 23e2322 commit 1dd4bf0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

java/ql/src/experimental/semmle/code/java/security/StaticInitializationVectorQuery.qll

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ private predicate initializedWithConstants(ArrayCreationExpr array) {
1111
or
1212
// creating a multidimensional array with an initializer like `{ new byte[8], new byte[16] }`
1313
// This works around https://github.com/github/codeql/issues/6552 -- change me once there is
14-
// a better way to distinguish nested initializers that create zero-filled arrays
14+
// a better way to distinguish nested initializers that create zero-filled arrays
1515
// (e.g. `new byte[1]`) from those with an initializer list (`new byte[] { 1 }` or just `{ 1 }`)
1616
array.getInit().getAnInit().getAChildExpr() instanceof IntegerLiteral
1717
or
@@ -85,9 +85,7 @@ private class ArrayUpdateConfig extends TaintTracking2::Configuration {
8585
private class StaticInitializationVectorSource extends DataFlow::Node {
8686
StaticInitializationVectorSource() {
8787
exists(StaticByteArrayCreation array | array = this.asExpr() |
88-
not exists(ArrayUpdate update, ArrayUpdateConfig config |
89-
config.hasFlow(DataFlow2::exprNode(array), DataFlow2::exprNode(update.getArray()))
90-
)
88+
not exists(ArrayUpdateConfig config | config.hasFlow(DataFlow2::exprNode(array), _))
9189
)
9290
}
9391
}

0 commit comments

Comments
 (0)