aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid LeGare <legare@google.com>2022-06-28 17:30:52 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-06-28 17:30:52 +0000
commit333bb2c8b777ab24a9d1c09c023d07889d9aece5 (patch)
tree4c6ff137e3d9c7716b0a7e4a5ff39eb7eb842392
parentcf860f583111589eefb20ed7b152b652f17b6489 (diff)
parent4c50cd59baa95b0bc0931143757788901c40c341 (diff)
downloadarbitrary-333bb2c8b777ab24a9d1c09c023d07889d9aece5.tar.gz
Upgrade rust/crates/arbitrary to 1.1.3 am: 9833b5f41e am: b802079c87 am: e96936d008 am: f25707c545 am: 4c50cd59ba
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/arbitrary/+/2137475 Change-Id: I674fe9daf758410bf261473521fa002eb61362d4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp6
-rw-r--r--CHANGELOG.md17
-rw-r--r--Cargo.toml4
-rw-r--r--Cargo.toml.orig4
-rw-r--r--METADATA6
-rw-r--r--src/lib.rs32
7 files changed, 46 insertions, 25 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 7b04689..b93af77 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,6 +1,6 @@
{
"git": {
- "sha1": "34be5b6d3d3bb513358e80453984652c88e07b75"
+ "sha1": "8e7b857f4f78b06920a36212ed2f392bc523c1f6"
},
"path_in_vcs": ""
} \ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 8c371a2..b909a3c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -42,7 +42,7 @@ rust_test {
host_supported: true,
crate_name: "arbitrary",
cargo_env_compat: true,
- cargo_pkg_version: "1.1.2",
+ cargo_pkg_version: "1.1.3",
srcs: ["src/lib.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
@@ -62,7 +62,7 @@ rust_test {
host_supported: true,
crate_name: "arbitrary",
cargo_env_compat: true,
- cargo_pkg_version: "1.1.2",
+ cargo_pkg_version: "1.1.3",
srcs: ["tests/derive.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
@@ -85,7 +85,7 @@ rust_library_rlib {
host_supported: true,
crate_name: "arbitrary",
cargo_env_compat: true,
- cargo_pkg_version: "1.1.2",
+ cargo_pkg_version: "1.1.3",
srcs: ["src/lib.rs"],
edition: "2018",
features: [
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 73e5142..656329c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,7 +28,22 @@ Released YYYY-MM-DD.
--------------------------------------------------------------------------------
-## Unreleased
+## 1.1.3
+
+Released 2022-06-23.
+
+### Fixed
+
+* Fixed some potential (but highly unlikely) name-clashes inside
+ `derive(Arbitrary)`'s generated
+ code. [#111](https://github.com/rust-fuzz/arbitrary/pull/111)
+* Fixed an edge case where `derive(Arbitrary)` for recursive types that detected
+ an overflow would not reset the overflow
+ detection. [#111](https://github.com/rust-fuzz/arbitrary/pull/111)
+
+--------------------------------------------------------------------------------
+
+## 1.1.2
Released 2022-06-16.
diff --git a/Cargo.toml b/Cargo.toml
index 684e705..67450da 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@
[package]
edition = "2018"
name = "arbitrary"
-version = "1.1.2"
+version = "1.1.3"
authors = [
"The Rust-Fuzz Project Developers",
"Nick Fitzgerald <fitzgen@gmail.com>",
@@ -42,7 +42,7 @@ path = "./tests/derive.rs"
required-features = ["derive"]
[dependencies.derive_arbitrary]
-version = "1.1.2"
+version = "1.1.3"
optional = true
[dev-dependencies]
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 01af004..9d600f3 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "arbitrary"
-version = "1.1.2" # Make sure this matches the derive crate version
+version = "1.1.3" # Make sure this matches the derive crate version
authors = [
"The Rust-Fuzz Project Developers",
"Nick Fitzgerald <fitzgen@gmail.com>",
@@ -19,7 +19,7 @@ repository = "https://github.com/rust-fuzz/arbitrary/"
documentation = "https://docs.rs/arbitrary/"
[dependencies]
-derive_arbitrary = { version = "1.1.2", path = "./derive", optional = true }
+derive_arbitrary = { version = "1.1.3", path = "./derive", optional = true }
[dev-dependencies]
diff --git a/METADATA b/METADATA
index e7cf6dc..b80ab3f 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/arbitrary/arbitrary-1.1.2.crate"
+ value: "https://static.crates.io/crates/arbitrary/arbitrary-1.1.3.crate"
}
- version: "1.1.2"
+ version: "1.1.3"
license_type: NOTICE
last_upgrade_date {
year: 2022
month: 6
- day: 16
+ day: 27
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 2de041d..bf91c21 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -140,12 +140,15 @@ pub trait Arbitrary<'a>: Sized {
/// Arbitrary>::arbitrary` to construct an arbitrary instance of `MyType`
/// from that unstuctured data.
///
- /// Implementation may return an error if there is not enough data to
- /// construct a full instance of `Self`. This is generally OK: it is better
- /// to exit early and get the fuzzer to provide more input data, than it is
- /// to generate default values in place of the missing data, which would
- /// bias the distribution of generated values, and ultimately make fuzzing
- /// less efficient.
+ /// Implementations may return an error if there is not enough data to
+ /// construct a full instance of `Self`, or they may fill out the rest of
+ /// `Self` with dummy values. Using dummy values when the underlying data is
+ /// exhausted can help avoid accidentally "defeating" some of the fuzzer's
+ /// mutations to the underlying byte stream that might otherwise lead to
+ /// interesting runtime behavior or new code coverage if only we had just a
+ /// few more bytes. However, it also requires that implementations for
+ /// recursive types (e.g. `struct Foo(Option<Box<Foo>>)`) avoid infinite
+ /// recursion when the underlying data is exhausted.
///
/// ```
/// # #[cfg(feature = "derive")] fn foo() {
@@ -174,11 +177,13 @@ pub trait Arbitrary<'a>: Sized {
/// See also the documentation for [`Unstructured`][crate::Unstructured].
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>;
- /// Generate an arbitrary value of `Self` from the entirety of the given unstructured data.
+ /// Generate an arbitrary value of `Self` from the entirety of the given
+ /// unstructured data.
///
- /// This is similar to Arbitrary::arbitrary, however it assumes that it is the
- /// last consumer of the given data, and is thus able to consume it all if it needs.
- /// See also the documentation for [`Unstructured`][crate::Unstructured].
+ /// This is similar to Arbitrary::arbitrary, however it assumes that it is
+ /// the last consumer of the given data, and is thus able to consume it all
+ /// if it needs. See also the documentation for
+ /// [`Unstructured`][crate::Unstructured].
fn arbitrary_take_rest(mut u: Unstructured<'a>) -> Result<Self> {
Self::arbitrary(&mut u)
}
@@ -208,9 +213,10 @@ pub trait Arbitrary<'a>: Sized {
/// of lengths bounded by these parameters. This applies to both
/// [`Arbitrary::arbitrary`] and [`Arbitrary::arbitrary_take_rest`].
///
- /// This is trivially true for `(0, None)`. To restrict this further, it must be proven
- /// that all inputs that are now excluded produced redundant outputs which are still
- /// possible to produce using the reduced input space.
+ /// This is trivially true for `(0, None)`. To restrict this further, it
+ /// must be proven that all inputs that are now excluded produced redundant
+ /// outputs which are still possible to produce using the reduced input
+ /// space.
///
/// ## The `depth` Parameter
///