Skip to content

Commit f57d691

Browse files
committed
Rust: Fix typo in model.
1 parent c7de873 commit f57d691

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

rust/ql/lib/codeql/rust/frameworks/async-rs.model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ extensions:
33
pack: codeql/rust-all
44
extensible: sourceModel
55
data:
6-
- ["<async-std::net::tcp::stream::TcpStream>::connect", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"]
6+
- ["<async_std::net::tcp::stream::TcpStream>::connect", "ReturnValue.Future.Field[core::result::Result::Ok(0)]", "remote", "manual"]

rust/ql/test/library-tests/dataflow/sources/TaintSources.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
| test.rs:779:22:779:50 | ...::new | Flow source 'RemoteSource' of type remote (DEFAULT). |
7676
| test.rs:806:16:806:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). |
7777
| test.rs:806:16:806:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). |
78+
| test_futures_io.rs:19:15:19:32 | ...::connect | Flow source 'RemoteSource' of type remote (DEFAULT). |
7879
| web_frameworks.rs:11:31:11:31 | a | Flow source 'RemoteSource' of type remote (DEFAULT). |
7980
| web_frameworks.rs:11:31:11:31 | a | Flow source 'RemoteSource' of type remote (DEFAULT). |
8081
| web_frameworks.rs:22:14:22:18 | TuplePat | Flow source 'RemoteSource' of type remote (DEFAULT). |

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ use std::task::{Context, Poll};
1616

1717
async fn test_futures_rustls_futures_io() -> io::Result<()> {
1818
let url = "www.example.com:443";
19-
let tcp = TcpStream::connect(url).await?; // $ MISSING: Alert[rust/summary/taint-sources]
20-
sink(&tcp); // $ MISSING: hasTaintFlow=url
19+
let tcp = TcpStream::connect(url).await?; // $ Alert[rust/summary/taint-sources]
20+
sink(&tcp); // $ hasTaintFlow=url
2121
let config = rustls::ClientConfig::builder()
2222
.with_root_certificates(rustls::RootCertStore::empty())
2323
.with_no_client_auth();
2424
let connector = TlsConnector::from(Arc::new(config));
2525
let server_name = rustls::pki_types::ServerName::try_from("www.example.com").unwrap();
2626
let mut reader = connector.connect(server_name, tcp).await?;
27-
sink(&reader); // $ MISSING: hasTaintFlow=url
27+
sink(&reader); // $ hasTaintFlow=url
2828

2929
{
3030
// using the `AsyncRead` trait (low-level)
3131
let mut buffer = [0u8; 64];
3232
let mut pinned = Pin::new(&mut reader);
33-
sink(&pinned); // $ MISSING: hasTaintFlow=url
33+
sink(&pinned); // $ hasTaintFlow=url
3434
let mut cx = Context::from_waker(futures::task::noop_waker_ref());
3535
let bytes_read = pinned.poll_read(&mut cx, &mut buffer); // we cannot correctly resolve this call, since it relies on `Deref`
3636
if let Poll::Ready(Ok(n)) = bytes_read {
@@ -52,12 +52,12 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
5252
}
5353

5454
let mut reader2 = futures::io::BufReader::new(reader);
55-
sink(&reader2); // $ MISSING: hasTaintFlow=url
55+
sink(&reader2); // $ hasTaintFlow=url
5656

5757
{
5858
// using the `AsyncBufRead` trait (low-level)
5959
let mut pinned = Pin::new(&mut reader2);
60-
sink(&pinned); // $ MISSING: hasTaintFlow=url
60+
sink(&pinned); // $ hasTaintFlow=url
6161
let mut cx = Context::from_waker(futures::task::noop_waker_ref());
6262
let buffer = pinned.poll_fill_buf(&mut cx);
6363
if let Poll::Ready(Ok(buf)) = buffer {
@@ -88,7 +88,7 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
8888
// using the `AsyncRead` trait (low-level)
8989
let mut buffer = [0u8; 64];
9090
let mut pinned = Pin::new(&mut reader2);
91-
sink(&pinned); // $ MISSING: hasTaintFlow=url
91+
sink(&pinned); // $ hasTaintFlow=url
9292
let mut cx = Context::from_waker(futures::task::noop_waker_ref());
9393
let bytes_read = pinned.poll_read(&mut cx, &mut buffer);
9494
sink(&buffer); // $ MISSING: hasTaintFlow=url
@@ -111,7 +111,7 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
111111
{
112112
// using the `AsyncBufRead` trait (low-level)
113113
let mut pinned = Pin::new(&mut reader2);
114-
sink(&pinned); // $ MISSING: hasTaintFlow=url
114+
sink(&pinned); // $ hasTaintFlow=url
115115
let mut cx = Context::from_waker(futures::task::noop_waker_ref());
116116
let buffer = pinned.poll_fill_buf(&mut cx);
117117
sink(&buffer); // $ MISSING: hasTaintFlow=url

0 commit comments

Comments
 (0)