aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Vander Stoep <jeffv@google.com>2023-02-16 15:20:15 +0100
committerJeff Vander Stoep <jeffv@google.com>2023-02-16 15:20:15 +0100
commit6a8c28f9fa83b00d54bcc8af1072d7f41cd2a483 (patch)
treefc2c8040d113c87472daf3a99fa770b4ad1f5c8c
parentd7d89537374529c133a979d6bace111dc467ab46 (diff)
downloadlibfuzzer-sys-6a8c28f9fa83b00d54bcc8af1072d7f41cd2a483.tar.gz
Upgrade libfuzzer-sys to 0.4.6
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update rust/crates/libfuzzer-sys For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md Test: TreeHugger Change-Id: I1522bbfff50cb835ee9cdae5934bc6a9896821dd
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp2
-rw-r--r--CHANGELOG.md12
-rw-r--r--Cargo.toml3
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA10
-rw-r--r--build.rs7
-rw-r--r--src/lib.rs10
8 files changed, 32 insertions, 16 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 2b01961..f360df2 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,6 +1,6 @@
{
"git": {
- "sha1": "396dc4ca1c8b4909ad24985dbe83a326ddfd2b82"
+ "sha1": "e07c487220402f5bec2151de2856a7caff0639c6"
},
"path_in_vcs": ""
} \ No newline at end of file
diff --git a/Android.bp b/Android.bp
index b24a7aa..ad3ff73 100644
--- a/Android.bp
+++ b/Android.bp
@@ -39,7 +39,7 @@ rust_library_rlib {
host_supported: true,
crate_name: "libfuzzer_sys",
cargo_env_compat: true,
- cargo_pkg_version: "0.4.5",
+ cargo_pkg_version: "0.4.6",
srcs: ["src/lib.rs"],
edition: "2018",
features: ["arbitrary-derive"],
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a924906..0fba42c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,18 @@ Released YYYY-MM-DD.
--------------------------------------------------------------------------------
+## 0.4.6
+
+Released 2023-01-26.
+
+### Fixed
+
+* Fixed a potential name conflict in functions generated by the `fuzz_target!`
+ macro.
+* Fixed potential stale builds when updating custom libfuzzers to link against.
+
+--------------------------------------------------------------------------------
+
## 0.4.5
Released 2022-10-18.
diff --git a/Cargo.toml b/Cargo.toml
index cee7559..b53945d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,13 +12,12 @@
[package]
edition = "2018"
name = "libfuzzer-sys"
-version = "0.4.5"
+version = "0.4.6"
authors = ["The rust-fuzz Project Developers"]
description = "A wrapper around LLVM's libFuzzer runtime."
readme = "./README.md"
license = "MIT/Apache-2.0/NCSA"
repository = "https://github.com/rust-fuzz/libfuzzer"
-resolver = "1"
[dependencies.arbitrary]
version = "1"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index bc5982d..1552302 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -6,7 +6,7 @@ license = "MIT/Apache-2.0/NCSA"
name = "libfuzzer-sys"
readme = "./README.md"
repository = "https://github.com/rust-fuzz/libfuzzer"
-version = "0.4.5"
+version = "0.4.6"
[dependencies]
arbitrary = "1"
diff --git a/METADATA b/METADATA
index 0e7f01d..02cbb38 100644
--- a/METADATA
+++ b/METADATA
@@ -11,13 +11,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/libfuzzer-sys/libfuzzer-sys-0.4.5.crate"
+ value: "https://static.crates.io/crates/libfuzzer-sys/libfuzzer-sys-0.4.6.crate"
}
- version: "0.4.5"
+ version: "0.4.6"
license_type: NOTICE
last_upgrade_date {
- year: 2022
- month: 12
- day: 12
+ year: 2023
+ month: 2
+ day: 16
}
}
diff --git a/build.rs b/build.rs
index bf6c12f..ab1bbc5 100644
--- a/build.rs
+++ b/build.rs
@@ -1,10 +1,15 @@
fn main() {
+ println!("cargo:rerun-if-env-changed=CUSTOM_LIBFUZZER_PATH");
if let Ok(custom) = ::std::env::var("CUSTOM_LIBFUZZER_PATH") {
+ println!("cargo:rerun-if-changed={custom}");
+
let custom_lib_path = ::std::path::PathBuf::from(&custom);
let custom_lib_dir = custom_lib_path.parent().unwrap().to_string_lossy();
let custom_lib_name = custom_lib_path.file_stem().unwrap().to_string_lossy();
- let custom_lib_name = custom_lib_name.trim_start_matches("lib");
+ let custom_lib_name = custom_lib_name
+ .strip_prefix("lib")
+ .unwrap_or(custom_lib_name.as_ref());
println!("cargo:rustc-link-search=native={}", custom_lib_dir);
println!("cargo:rustc-link-lib=static={}", custom_lib_name);
diff --git a/src/lib.rs b/src/lib.rs
index ce1eb98..376feb9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -221,7 +221,7 @@ macro_rules! fuzz_target {
return 0;
}
- run(bytes);
+ __libfuzzer_sys_run(bytes);
0
}
@@ -234,11 +234,11 @@ macro_rules! fuzz_target {
// panics in separate fuzzers can accidentally appear the same
// because each fuzzer will have a function called
// `rust_fuzzer_test_input`. By using a normal Rust function here
- // it's named something like `the_fuzzer_name::_::run` which should
+ // it's named something like `the_fuzzer_name::_::__libfuzzer_sys_run` which should
// ideally help prevent oss-fuzz from deduplicate fuzz bugs across
// distinct targets accidentally.
#[inline(never)]
- fn run($bytes: &[u8]) {
+ fn __libfuzzer_sys_run($bytes: &[u8]) {
$body
}
};
@@ -294,13 +294,13 @@ macro_rules! fuzz_target {
Err(_) => return -1,
};
- let result = ::libfuzzer_sys::Corpus::from(run(data));
+ let result = ::libfuzzer_sys::Corpus::from(__libfuzzer_sys_run(data));
result.to_libfuzzer_code()
}
// See above for why this is split to a separate function.
#[inline(never)]
- fn run($data: $dty) -> $rty {
+ fn __libfuzzer_sys_run($data: $dty) -> $rty {
$body
}
};