Skip to content

Commit db77c6b

Browse files
author
Stephan Brandauer
committed
Java: mark functional expressions as likely not sinks
1 parent 76d731a commit db77c6b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

java/ql/src/Telemetry/AutomodelApplicationModeCharacteristics.qll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,17 @@ private class OtherArgumentToModeledMethodCharacteristic extends Characteristics
328328
}
329329
}
330330

331+
/**
332+
* A characteristic that marks functional expression as likely not sinks.
333+
*
334+
* These expressions may well _contain_ sinks, but rarely are sinks themselves.
335+
*/
336+
private class FunctionValueCharacteristic extends CharacteristicsImpl::LikelyNotASinkCharacteristic {
337+
FunctionValueCharacteristic() { this = "function value" }
338+
339+
override predicate appliesToEndpoint(Endpoint e) { e.asExpr() instanceof FunctionalExpr }
340+
}
341+
331342
/**
332343
* A negative characteristic that indicates that an endpoint is not a `to` node for any known taint step. Such a node
333344
* cannot be tainted, because taint can't flow into it.

0 commit comments

Comments
 (0)