mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Move private helper method out of module
This commit is contained in:
@@ -28,16 +28,16 @@ class Yaml extends RefType {
|
||||
Yaml() { this.getAnAncestor().hasQualifiedName("org.yaml.snakeyaml", "Yaml") }
|
||||
}
|
||||
|
||||
private DataFlow::ExprNode yamlClassInstanceExprArgument(ClassInstanceExpr cie) {
|
||||
cie.getConstructedType() instanceof Yaml and
|
||||
result.getExpr() = cie.getArgument(0)
|
||||
}
|
||||
|
||||
private module SafeYamlConstructionFlowConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node src) { src.asExpr() instanceof SafeSnakeYamlConstruction }
|
||||
|
||||
predicate isSink(DataFlow::Node sink) { sink = yamlClassInstanceExprArgument(_) }
|
||||
|
||||
additional DataFlow::ExprNode yamlClassInstanceExprArgument(ClassInstanceExpr cie) {
|
||||
cie.getConstructedType() instanceof Yaml and
|
||||
result.getExpr() = cie.getArgument(0)
|
||||
}
|
||||
|
||||
additional ClassInstanceExpr getSafeYaml() {
|
||||
SafeYamlConstructionFlow::flowTo(yamlClassInstanceExprArgument(result))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user