diff --git a/go/ql/lib/change-notes/2024-05-08-fix-flow-variadic-builtin-variable.md b/go/ql/lib/change-notes/2024-05-08-fix-flow-variadic-builtin-variable.md new file mode 100644 index 000000000000..9d9dabb34a2e --- /dev/null +++ b/go/ql/lib/change-notes/2024-05-08-fix-flow-variadic-builtin-variable.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Fixed a bug that stopped data flow from being followed through variadic arguments to built-in functions or to functions called using a variable. diff --git a/go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll b/go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll index 6b230bc728f8..947491b44bbc 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/DataFlowNodes.qll @@ -455,8 +455,8 @@ module Public { CallNode getCallNode() { result = call } override Type getType() { - exists(Function f | f = call.getTarget() | - result = f.getParameterType(f.getNumParameter() - 1) + exists(SignatureType t | t = call.getCall().getCalleeType() | + result = t.getParameterType(t.getNumParameter() - 1) ) }