mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Update UnhandledStreamPipe.ql
Address comments Co-Authored-By: Asger F <316427+asgerf@users.noreply.github.com>
This commit is contained in:
@@ -141,11 +141,12 @@ private predicate streamFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
|
||||
* Tracks the result of a pipe call as it flows through the program.
|
||||
*/
|
||||
private DataFlow::SourceNode destinationStreamRef(DataFlow::TypeTracker t, PipeCall pipe) {
|
||||
t.start() and result = pipe
|
||||
t.start() and
|
||||
(result = pipe or result = pipe.getDestinationStream().getALocalSource())
|
||||
or
|
||||
exists(DataFlow::SourceNode prev |
|
||||
prev = destinationStreamRef(t.continue(), pipe) and
|
||||
streamFlowStep(result.getALocalUse(), prev)
|
||||
streamFlowStep(prev, result)
|
||||
)
|
||||
or
|
||||
exists(DataFlow::TypeTracker t2 | result = destinationStreamRef(t2, pipe).track(t2, t))
|
||||
|
||||
Reference in New Issue
Block a user