mirror of
https://github.com/github/codeql.git
synced 2026-04-22 23:35:14 +02:00
Rust: Additional test cases exposing what works and what doesn't.
This commit is contained in:
@@ -19,5 +19,6 @@
|
||||
| test.rs:72:26:72:37 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). |
|
||||
| test.rs:75:26:75:37 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). |
|
||||
| test.rs:78:24:78:35 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). |
|
||||
| test.rs:108:31:108:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). |
|
||||
| test.rs:192:16:192:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs. |
|
||||
| test.rs:110:35:110:46 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). |
|
||||
| test.rs:117:31:117:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). |
|
||||
| test.rs:201:16:201:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs. |
|
||||
|
||||
@@ -104,9 +104,18 @@ async fn test_hyper_http(case: i64) -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
// make the request
|
||||
println!("sending request...");
|
||||
if (case == 0) {
|
||||
// simple flow case
|
||||
let request = http::Request::builder().uri(url).body(String::from(""))?;
|
||||
let mut response = sender.send_request(request).await?; // $ Alert[rust/summary/taint-sources]
|
||||
sink(&response); // $ hasTaintFlow=request
|
||||
sink(response); // $ hasTaintFlow=request
|
||||
return Ok(())
|
||||
}
|
||||
// more realistic uses of results...
|
||||
let request = http::Request::builder().uri(url).body(String::from(""))?;
|
||||
let mut response = sender.send_request(request).await?; // $ Alert[rust/summary/taint-sources]
|
||||
sink(&response); // $ MISSING: hasTaintFlow
|
||||
sink(&response); // $ MISSING: hasTaintFlow=request
|
||||
|
||||
if !response.status().is_success() {
|
||||
return Err("request failed".into())
|
||||
|
||||
Reference in New Issue
Block a user