fix ql-for-ql warnings

This commit is contained in:
Stephan Brandauer
2022-08-11 10:53:05 +02:00
parent 3aa4e29dae
commit 068a948c05
2 changed files with 1 additions and 36 deletions

View File

@@ -334,7 +334,7 @@ class ContextSurroundingFunctionParameters extends EndpointFeature,
override string getValue(DataFlow::Node endpoint) {
result =
concat(string functionParameterLine, Function f |
f = getRelevantFunction(endpoint) and
f = this.getRelevantFunction(endpoint) and
functionParameterLine = SyntacticUtilities::getFunctionParametersFeatureComponent(f)
|
functionParameterLine, "\n"
@@ -471,17 +471,6 @@ class ContextFunctionInterfaces extends EndpointFeature, TContextFunctionInterfa
* Syntactic utilities for feature value computation.
*/
private module SyntacticUtilities {
bindingset[start, end]
string renderStringConcatOperands(DataFlow::Node root, int start, int end) {
result =
concat(int i, string operand |
i = [start .. end] and
operand = renderStringConcatOperand(StringConcatenation::getOperand(root, i))
|
operand, " + " order by i
)
}
string renderStringConcatOperand(DataFlow::Node operand) {
if exists(unique(string v | operand.mayHaveStringValue(v)))
then result = "'" + any(string v | operand.mayHaveStringValue(v)) + "'"
@@ -544,7 +533,6 @@ private module SyntacticUtilities {
result =
concat(Function func, string line |
func.getFile() = file and
exists(func.getName()) and
line = func.getName() + getFunctionParametersFeatureComponent(func)
|
line, "\n" order by line

View File

@@ -1,23 +0,0 @@
import experimental.adaptivethreatmodeling.TaintedPathATM
import experimental.adaptivethreatmodeling.EndpointFeatures
import experimental.adaptivethreatmodeling.EndpointScoring
string getValueOrNone(EndpointFeature feature, DataFlow::Node endpoint) {
if exists(feature.getValue(endpoint)) then feature.getValue(endpoint) = result else isNone(result)
}
predicate isNone(string value) { value = "" }
// query for comparing feature values
from
DataFlow::Node endpoint, EndpointFeature feature1, EndpointFeature feature2, string featureValue1,
string featureValue2
where
feature1 instanceof Input_ArgumentIndex and
feature2 instanceof ArgumentIndex and
featureValue1 = getValueOrNone(feature1, endpoint) and
featureValue2 = getValueOrNone(feature2, endpoint) and
featureValue1 != featureValue2 and
isNone([featureValue1, featureValue2])
select endpoint, endpoint.getFile().getBaseName() as file, endpoint.getStartLine() as line,
featureValue1, featureValue2