Skip to content

Commit 4d51a15

Browse files
committed
Rust: Add model variants for when the qualifier is expressed as an arg (reference). We shouldn't need these.
1 parent 84c72f6 commit 4d51a15

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

rust/ql/lib/codeql/rust/frameworks/futures.model.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ extensions:
66
- ["repo:https://github.com/rust-lang/futures-rs:futures-executor", "crate::local_pool::block_on", "Argument[0]", "ReturnValue", "value", "manual"]
77
- ["repo:https://github.com/rust-lang/futures-rs:futures-util", "<crate::io::buf_reader::BufReader>::new", "Argument[0]", "ReturnValue", "taint", "manual"]
88
- ["repo:https://github.com/rust-lang/futures-rs:futures-util", "crate::io::AsyncReadExt::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"]
9+
- ["repo:https://github.com/rust-lang/futures-rs:futures-util", "crate::io::AsyncReadExt::read", "Argument[self].Reference", "Argument[0].Reference", "taint", "manual"]
910
- ["repo:https://github.com/rust-lang/futures-rs:futures-util", "crate::io::AsyncReadExt::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"]
11+
- ["repo:https://github.com/rust-lang/futures-rs:futures-util", "crate::io::AsyncReadExt::read_to_end", "Argument[self].Reference", "Argument[0].Reference", "taint", "manual"]
1012
- ["repo:https://github.com/rust-lang/futures-rs:futures-util", "crate::io::AsyncBufReadExt::read_line", "Argument[self]", "Argument[0].Reference", "taint", "manual"]
13+
- ["repo:https://github.com/rust-lang/futures-rs:futures-util", "crate::io::AsyncBufReadExt::read_line", "Argument[self].Reference", "Argument[0].Reference", "taint", "manual"]
1114
- ["repo:https://github.com/rust-lang/futures-rs:futures-util", "crate::io::AsyncBufReadExt::read_until", "Argument[self]", "Argument[1].Reference", "taint", "manual"]
15+
- ["repo:https://github.com/rust-lang/futures-rs:futures-util", "crate::io::AsyncBufReadExt::read_until", "Argument[self].Reference", "Argument[1].Reference", "taint", "manual"]

rust/ql/test/library-tests/dataflow/sources/test_futures_io.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
4343
// using the `AsyncReadExt::read` extension method (higher-level)
4444
let mut buffer1 = [0u8; 64];
4545
let bytes_read1 = futures::io::AsyncReadExt::read(&mut reader, &mut buffer1).await?;
46-
sink(&buffer1[..bytes_read1]); // $ MISSING: hasTaintFlow
46+
sink(&buffer1[..bytes_read1]); // $ hasTaintFlow=url
4747

4848
let mut buffer2 = [0u8; 64];
4949
let bytes_read2 = reader.read(&mut buffer2).await?;
@@ -100,7 +100,7 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
100100
// using the `AsyncReadExt::read` extension method (higher-level)
101101
let mut buffer1 = [0u8; 64];
102102
let bytes_read1 = futures::io::AsyncReadExt::read(&mut reader2, &mut buffer1).await?;
103-
sink(&buffer1[..bytes_read1]); // $ MISSING: hasTaintFlow
103+
sink(&buffer1[..bytes_read1]); // $ hasTaintFlow=url
104104

105105
let mut buffer2 = [0u8; 64];
106106
let bytes_read2 = reader2.read(&mut buffer2).await?;

0 commit comments

Comments
 (0)