Skip to content

Commit d704b75

Browse files
committed
Fix CP in typeFlowParamType
Forgot to link `p` with `c` using `nodeEnclosingCallable(p, c)`.
1 parent 0d4524f commit d704b75

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,11 +2115,13 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
21152115
* context.
21162116
*/
21172117
private predicate typeFlowParamType(ParamNode p, Type t, boolean cc) {
2118-
exists(Callable c |
2119-
Input::dataFlowNonCallEntry(c, cc) and
2120-
if cc = true and exists(getSourceContextParameterNodeType(p))
2121-
then t = getSourceContextParameterNodeType(p)
2122-
else trackedParamWithType(p, t, c)
2118+
exists(Callable c | Input::dataFlowNonCallEntry(c, cc) |
2119+
cc = true and
2120+
nodeEnclosingCallable(p, c) and
2121+
t = getSourceContextParameterNodeType(p)
2122+
or
2123+
(cc = false or not exists(getSourceContextParameterNodeType(p))) and
2124+
trackedParamWithType(p, t, c)
21232125
)
21242126
or
21252127
exists(Type t1, Type t2 |

0 commit comments

Comments
 (0)