Skip to content

Commit 392b2af

Browse files
committed
C++: Only the second indirection of the argument should be the remote flow source.
1 parent b82dfa9 commit 392b2af

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private class Getaddrinfo extends TaintFunction, ArrayFunction, RemoteFlowSource
157157
override predicate hasArrayWithNullTerminator(int bufParam) { bufParam in [0, 1] }
158158

159159
override predicate hasRemoteFlowSource(FunctionOutput output, string description) {
160-
output.isParameterDeref(3) and
160+
output.isParameterDeref(3, 2) and
161161
description = "address returned by " + this.getName()
162162
}
163163
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
testFailures
2-
| sources-and-sinks.cpp:51:52:51:55 | getaddrinfo output argument | Unexpected result: remote_source=51:52 |
3-
| sources-and-sinks.cpp:51:59:51:76 | // $ remote_source | Missing result:remote_source= |
42
failures

0 commit comments

Comments
 (0)