mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
Ruby: Avoid a forced CP.
This commit is contained in:
@@ -54,6 +54,14 @@ class NetHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode {
|
||||
override DataFlow::Node getAUrlPart() {
|
||||
result = request.getArgument(0)
|
||||
or
|
||||
result = this.getAUrlPartFromConstructor()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a node that contributes to the URL of the request
|
||||
* indirectly, through the constructor.
|
||||
*/
|
||||
private DataFlow::Node getAUrlPartFromConstructor() {
|
||||
// Net::HTTP.new(...).get(...)
|
||||
exists(API::Node new |
|
||||
new = API::getTopLevelMember("Net").getMember("HTTP").getInstance() and
|
||||
|
||||
Reference in New Issue
Block a user