Skip to content

Commit bf2f19d

Browse files
Napalysasgerf
andcommitted
Update UnhandledStreamPipe.ql
Address comments Co-Authored-By: Asger F <[email protected]>
1 parent ae74edb commit bf2f19d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

javascript/ql/src/Quality/UnhandledStreamPipe.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,12 @@ private predicate streamFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
141141
* Tracks the result of a pipe call as it flows through the program.
142142
*/
143143
private DataFlow::SourceNode destinationStreamRef(DataFlow::TypeTracker t, PipeCall pipe) {
144-
t.start() and result = pipe
144+
t.start() and
145+
(result = pipe or result = pipe.getDestinationStream().getALocalSource())
145146
or
146147
exists(DataFlow::SourceNode prev |
147148
prev = destinationStreamRef(t.continue(), pipe) and
148-
streamFlowStep(result.getALocalUse(), prev)
149+
streamFlowStep(prev, result)
149150
)
150151
or
151152
exists(DataFlow::TypeTracker t2 | result = destinationStreamRef(t2, pipe).track(t2, t))

0 commit comments

Comments
 (0)