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

Commit a78c35b

Browse files
Sauyon Leesmowton
authored andcommitted
Simplify net/http ResponseBody logic
1 parent 8a306af commit a78c35b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

ql/src/semmle/go/frameworks/stdlib/NetHttp.qll

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,10 @@ module NetHttp {
145145
responseWriter = call.(DataFlow::MethodCallNode).getReceiver()
146146
)
147147
or
148-
exists(
149-
TaintTracking::FunctionModel model, FunctionOutput modelOutput, FunctionInput modelInput,
150-
DataFlow::CallNode call
151-
|
148+
exists(TaintTracking::FunctionModel model |
152149
// A modelled function conveying taint from some input to the response writer,
153150
// e.g. `io.Copy(responseWriter, someTaintedReader)`
154-
call = model.getACall() and
155-
model.hasTaintFlow(modelInput, modelOutput) and
156-
this = modelInput.getNode(call) and
157-
responseWriter = modelOutput.getNode(call).(DataFlow::PostUpdateNode).getPreUpdateNode() and
151+
model.taintStep(this, responseWriter) and
158152
responseWriter.getType().implements("net/http", "ResponseWriter")
159153
)
160154
}

0 commit comments

Comments
 (0)