abort() when the weakly defined LLVMFuzzerTestOneInput is linked(#2289)
This commit is contained in:
parent
14263b9c69
commit
1e2fac6f53
@ -1,5 +1,8 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <malloc/malloc.h>
|
#include <malloc/malloc.h>
|
||||||
#else
|
#else
|
||||||
@ -18,6 +21,8 @@ EXT_FUNC(LLVMFuzzerCustomCrossOver, size_t,
|
|||||||
false);
|
false);
|
||||||
EXT_FUNC_IMPL(LLVMFuzzerTestOneInput, int, (const uint8_t *Data, size_t Size),
|
EXT_FUNC_IMPL(LLVMFuzzerTestOneInput, int, (const uint8_t *Data, size_t Size),
|
||||||
false) {
|
false) {
|
||||||
|
fprintf(stderr, "Weakly defined \"LLVMFuzzerTestOneInput\" is linked. Did you add extern \"C\" to your harness?\n");
|
||||||
|
abort();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|||||||
LIBAFL_DIR=$(realpath "$SCRIPT_DIR/..")
|
LIBAFL_DIR=$(realpath "$SCRIPT_DIR/..")
|
||||||
|
|
||||||
if [ "$1" = "check" ]; then
|
if [ "$1" = "check" ]; then
|
||||||
cargo run --manifest-path "$LIBAFL_DIR/utils/libafl_fmt/Cargo.toml" --release -- -c
|
cargo run --manifest-path "$LIBAFL_DIR/utils/libafl_fmt/Cargo.toml" --release -- -c --verbose
|
||||||
else
|
else
|
||||||
cargo run --manifest-path "$LIBAFL_DIR/utils/libafl_fmt/Cargo.toml" --release
|
cargo run --manifest-path "$LIBAFL_DIR/utils/libafl_fmt/Cargo.toml" --release -- --verbose
|
||||||
fi
|
fi
|
||||||
|
@ -31,7 +31,7 @@ async fn run_cargo_fmt(path: PathBuf, is_check: bool, verbose: bool) -> io::Resu
|
|||||||
let res = fmt_command.output().await?;
|
let res = fmt_command.output().await?;
|
||||||
|
|
||||||
if !res.status.success() {
|
if !res.status.success() {
|
||||||
println!("{}", from_utf8(&res.stdout).unwrap());
|
println!("{}", from_utf8(&res.stderr).unwrap());
|
||||||
return Err(io::Error::new(ErrorKind::Other, "Cargo fmt failed."));
|
return Err(io::Error::new(ErrorKind::Other, "Cargo fmt failed."));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,6 +96,7 @@ async fn main() -> io::Result<()> {
|
|||||||
r".*utils/gdb_qemu.*",
|
r".*utils/gdb_qemu.*",
|
||||||
r".*docs/listings/baby_fuzzer/listing-.*",
|
r".*docs/listings/baby_fuzzer/listing-.*",
|
||||||
r".*LibAFL/Cargo.toml.*",
|
r".*LibAFL/Cargo.toml.*",
|
||||||
|
r".*AFLplusplus.*",
|
||||||
])
|
])
|
||||||
.expect("Could not create the regex set from the given regex");
|
.expect("Could not create the regex set from the given regex");
|
||||||
|
|
||||||
@ -105,6 +106,7 @@ async fn main() -> io::Result<()> {
|
|||||||
r".*stb_image\.h$",
|
r".*stb_image\.h$",
|
||||||
r".*dlmalloc\.c$",
|
r".*dlmalloc\.c$",
|
||||||
r".*QEMU-Nyx.*",
|
r".*QEMU-Nyx.*",
|
||||||
|
r".*AFLplusplus.*",
|
||||||
])
|
])
|
||||||
.expect("Could not create the regex set from the given regex");
|
.expect("Could not create the regex set from the given regex");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user