Skip to content

Commit 588447d

Browse files
committed
C++: Fix up isParameterDeref.
1 parent 4326e6f commit 588447d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

cpp/ql/lib/semmle/code/cpp/models/implementations/Gets.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private class FgetsFunction extends DataFlowFunction, TaintFunction, ArrayFuncti
5959

6060
override predicate hasArrayOutput(int bufParam) { bufParam = 0 }
6161

62-
override predicate hasSocketInput(FunctionInput input) { input.isParameter(2) }
62+
override predicate hasSocketInput(FunctionInput input) { input.isParameterDeref(2) }
6363
}
6464

6565

cpp/ql/src/Security/CWE/CWE-311/CleartextTransmission.ql

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ class Send extends SendRecv instanceof RemoteFlowSinkFunction {
5858
call.getTarget() = this and
5959
exists(FunctionInput input, int arg |
6060
super.hasSocketInput(input) and
61-
input.isParameter(arg) and
61+
(
62+
input.isParameter(arg) or
63+
input.isParameterDeref(arg)
64+
) and
6265
result = call.getArgument(arg)
6366
)
6467
}
@@ -81,7 +84,10 @@ class Recv extends SendRecv instanceof RemoteFlowSourceFunction {
8184
call.getTarget() = this and
8285
exists(FunctionInput input, int arg |
8386
super.hasSocketInput(input) and
84-
input.isParameter(arg) and
87+
(
88+
input.isParameter(arg) or
89+
input.isParameterDeref(arg)
90+
) and
8591
result = call.getArgument(arg)
8692
)
8793
}

0 commit comments

Comments
 (0)