Skip to content

Commit a03507a

Browse files
committed
avoid cartesian product in isFilteredPropertyName
1 parent e0dca2b commit a03507a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

javascript/ql/src/semmle/javascript/security/dataflow/CleartextLoggingCustomizations.qll

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,20 +221,16 @@ module CleartextLogging {
221221
/**
222222
* Holds if `name` is filtered by e.g. a regular-expression test or a filter call.
223223
*/
224-
private predicate isFilteredPropertyName(DataFlow::Node name) {
224+
private predicate isFilteredPropertyName(DataFlow::SourceNode name) {
225225
exists(DataFlow::MethodCallNode reduceCall |
226-
reduceCall.getABoundCallbackParameter(0, 1).flowsTo(name) and
227-
reduceCall.getMethodName() = "reduce"
226+
reduceCall.getMethodName() = "reduce" and
227+
reduceCall.getABoundCallbackParameter(0, 1) = name
228228
|
229229
reduceCall.getReceiver+().(DataFlow::MethodCallNode).getMethodName() = "filter"
230230
)
231231
or
232-
exists(StringOps::RegExpTest test |
233-
test.getStringOperand().getALocalSource() = name.getALocalSource()
234-
)
232+
exists(StringOps::RegExpTest test | test.getStringOperand().getALocalSource() = name)
235233
or
236-
exists(MembershipCandidate test |
237-
test.getAMemberNode().getALocalSource() = name.getALocalSource()
238-
)
234+
exists(MembershipCandidate test | test.getAMemberNode().getALocalSource() = name)
239235
}
240236
}

0 commit comments

Comments
 (0)