mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
Ruby: avoid toString in query warning
This commit is contained in:
@@ -31,7 +31,12 @@ module CodeInjection {
|
||||
|
||||
/** Flow states used to distinguish whether an attacker controls the entire string. */
|
||||
class State extends TState {
|
||||
string toString() {
|
||||
string toString() { result = this.getStringRepresentation() }
|
||||
|
||||
/**
|
||||
* Gets a canonical string representation of this state.
|
||||
*/
|
||||
string getStringRepresentation() {
|
||||
this = TSubString() and result = "substring"
|
||||
or
|
||||
this = TFull() and result = "full"
|
||||
|
||||
@@ -29,7 +29,7 @@ where
|
||||
otherSink) and
|
||||
otherSink.getNode() = sink.getNode()
|
||||
|
|
||||
otherSink order by otherSink.getState().toString()
|
||||
otherSink order by otherSink.getState().getStringRepresentation()
|
||||
)
|
||||
select sink.getNode(), source, sink, "This code execution depends on a $@.", sourceNode,
|
||||
"user-provided value"
|
||||
|
||||
Reference in New Issue
Block a user