mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Java: Allow null literals as sources in data flow.
This commit is contained in:
14
java/ql/test/library-tests/dataflow/null/testnullflow.ql
Normal file
14
java/ql/test/library-tests/dataflow/null/testnullflow.ql
Normal file
@@ -0,0 +1,14 @@
|
||||
import java
|
||||
import semmle.code.java.dataflow.DataFlow
|
||||
|
||||
class Conf extends DataFlow::Configuration {
|
||||
Conf() { this = "qqconf" }
|
||||
|
||||
override predicate isSource(DataFlow::Node n) { n.asExpr() instanceof NullLiteral }
|
||||
|
||||
override predicate isSink(DataFlow::Node n) { any() }
|
||||
}
|
||||
|
||||
from Conf conf, DataFlow::Node src, DataFlow::Node sink
|
||||
where conf.hasFlow(src, sink)
|
||||
select src, sink
|
||||
Reference in New Issue
Block a user