mirror of
https://github.com/github/codeql.git
synced 2026-05-13 18:59:27 +02:00
36 lines
1.0 KiB
Plaintext
36 lines
1.0 KiB
Plaintext
/** This tests that we are able to detect remote flow sources and sinks. */
|
|
|
|
import cpp
|
|
import TestUtilities.InlineExpectationsTest
|
|
import semmle.code.cpp.security.FlowSources
|
|
|
|
class RemoteFlowSourceTest extends InlineExpectationsTest {
|
|
RemoteFlowSourceTest() { this = "RemoteFlowSourceTest" }
|
|
|
|
override string getARelevantTag() { result = "remote_source" }
|
|
|
|
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
|
tag = "remote_source" and
|
|
value = "" and
|
|
exists(RemoteFlowSource node |
|
|
location = node.getLocation() and
|
|
element = node.toString()
|
|
)
|
|
}
|
|
}
|
|
|
|
class RemoteFlowSinkTest extends InlineExpectationsTest {
|
|
RemoteFlowSinkTest() { this = "RemoteFlowSinkTest" }
|
|
|
|
override string getARelevantTag() { result = "remote_sink" }
|
|
|
|
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
|
tag = "remote_sink" and
|
|
value = "" and
|
|
exists(RemoteFlowSink node |
|
|
location = node.getLocation() and
|
|
element = node.toString()
|
|
)
|
|
}
|
|
}
|