Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Smithy to 1.16.1 #1053

Merged
merged 11 commits into from
Jan 12, 2022
3 changes: 3 additions & 0 deletions rust-runtime/aws-smithy-http/fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
corpus
artifacts
26 changes: 26 additions & 0 deletions rust-runtime/aws-smithy-http/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "aws-smithy-http-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.4"
http = "0.2.3"

[dependencies.aws-smithy-http]
path = ".."

# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[[bin]]
name = "read_many_from_str"
path = "fuzz_targets/read_many_from_str.rs"
test = false
doc = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#![no_main]
use libfuzzer_sys::fuzz_target;

use aws_smithy_http::header::read_many_from_str;
use http;

fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
if let Ok(req) = http::Request::builder().header("test", s).body(()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this ever return OK? you can make a request without a URI?

Copy link
Collaborator Author

@jdisanti jdisanti Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the builder builds successfully. I verified by adding a panic! inside of the conditions, and it definitely gets triggered.

// Shoudln't panic
let _ = read_many_from_str::<String>(req.headers().get_all("test").iter());
}
}
});