mirror of
https://github.com/github/codeql.git
synced 2026-05-04 21:25:44 +02:00
Rust: Add source models for io.
This commit is contained in:
@@ -128,6 +128,32 @@ module FileSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A data flow source corresponding to standard input.
|
||||
*/
|
||||
final class StdInSource = StdInSource::Range;
|
||||
|
||||
/**
|
||||
* An externally modeled source for data from standard input.
|
||||
*/
|
||||
class ModeledStdInSourceSource extends StdInSource::Range {
|
||||
ModeledStdInSourceSource() { sourceNode(this, "stdin") }
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a class for modeling new sources for standard input.
|
||||
*/
|
||||
module StdInSource {
|
||||
/**
|
||||
* A data flow source corresponding to standard input.
|
||||
*/
|
||||
abstract class Range extends ThreatModelSource::Range {
|
||||
override string getThreatModel() { result = "stdin" }
|
||||
|
||||
override string getSourceType() { result = "StdInSource" }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A data flow source corresponding to the program's database reads.
|
||||
*/
|
||||
|
||||
6
rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml
Normal file
6
rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
extensions:
|
||||
- addsTo:
|
||||
pack: codeql/rust-all
|
||||
extensible: sourceModel
|
||||
data:
|
||||
- ["lang:std", "crate::io::stdio::stdin", "ReturnValue", "stdin", "manual"]
|
||||
Reference in New Issue
Block a user