mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #16619 from owen-mc/go/fix/response-writer-variadic
Go: Fix bug in ResponseWriter for variadic MaD
This commit is contained in:
@@ -123,9 +123,19 @@ module NetHttp {
|
|||||||
private DataFlow::Node getSummaryInputOrOutputNode(
|
private DataFlow::Node getSummaryInputOrOutputNode(
|
||||||
DataFlow::CallNode call, SummaryComponentStack stack
|
DataFlow::CallNode call, SummaryComponentStack stack
|
||||||
) {
|
) {
|
||||||
exists(int n |
|
exists(int n | result = call.getSyntacticArgument(n) |
|
||||||
stack = SummaryComponentStack::argument(n) and
|
if result = call.getImplicitVarargsArgument(_)
|
||||||
result = call.getArgument(n)
|
then
|
||||||
|
exists(
|
||||||
|
int lastParamIndex, SummaryComponentStack varArgsSliceArgument,
|
||||||
|
SummaryComponent arrayContentSC, DataFlow::ArrayContent arrayContent
|
||||||
|
|
|
||||||
|
lastParamIndex = call.getCall().getCalleeType().getNumParameter() - 1 and
|
||||||
|
varArgsSliceArgument = SummaryComponentStack::argument(lastParamIndex) and
|
||||||
|
arrayContentSC = SummaryComponent::content(arrayContent) and
|
||||||
|
stack = SummaryComponentStack::push(arrayContentSC, varArgsSliceArgument)
|
||||||
|
)
|
||||||
|
else stack = SummaryComponentStack::argument(n)
|
||||||
)
|
)
|
||||||
or
|
or
|
||||||
stack = SummaryComponentStack::argument(-1) and
|
stack = SummaryComponentStack::argument(-1) and
|
||||||
|
|||||||
Reference in New Issue
Block a user