Skip to content

Commit 9d6ece1

Browse files
committed
Data flow: Restrict lambda reads at actual lambda calls
1 parent 6ef4aef commit 9d6ece1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll

+3-1
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,9 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
17971797
or
17981798
exists(ArgumentPosition apos |
17991799
c.getAReadContent() = getLambdaArgumentContent(k, apos) and
1800-
node2.asNode().(PostUpdateNode).getPreUpdateNode().(ArgNode).argumentOf(call, apos)
1800+
node2.asNode().(PostUpdateNode).getPreUpdateNode().(ArgNode).argumentOf(call, apos) and
1801+
// we should never read from the lambda itself
1802+
not any(ArgNodeEx arg | exists(arg.asLambdaMallocNode())).argumentOf(_, apos)
18011803
)
18021804
)
18031805
or

0 commit comments

Comments
 (0)