Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 9b4e189

Browse files
committed
Insecure-TLS: Use DataFlow::Node::getRoot, and factor getEnclosingFunction
1 parent 2751552 commit 9b4e189

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ql/src/experimental/CWE-327/InsecureTLS.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ where
239239
// Exclude sources or sinks that occur lexically within a block related to a feature or legacy flag
240240
not astNodeIsFlag([source, sink].getNode().asExpr().getParent*(), [featureFlag(), legacyFlag()]) and
241241
// Exclude results in functions whose name documents insecurity
242-
not exists(FuncDef fn | fn = sink.getNode().asInstruction().getRoot() |
243-
isFeatureFlagName(fn.getEnclosingFunction*().getName()) or
244-
isLegacyFlagName(fn.getEnclosingFunction*().getName())
242+
not exists(FuncDef fn | fn = sink.getNode().getRoot().getEnclosingFunction*() |
243+
isFeatureFlagName(fn.getName()) or
244+
isLegacyFlagName(fn.getName())
245245
)
246246
select sink.getNode(), source, sink, message

0 commit comments

Comments
 (0)