diff options
author | van Hauser <vh@thc.org> | 2024-06-18 15:28:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-18 15:28:56 +0200 |
commit | 3ebf41ba34a6dc57f6a094987fc53b814fc25da5 (patch) | |
tree | e3c5a88af3ba31213b1a5e929242414017f7eed1 /src/afl-performance.c | |
parent | a6e42d98d9d3e936dc74729f17ab1208d477c944 (diff) | |
parent | 304e84502d9bd8a5ac33328ceb63235f42b887ad (diff) | |
download | afl++-3ebf41ba34a6dc57f6a094987fc53b814fc25da5.tar.gz |
Merge pull request #2128 from AFLplusplus/fastrestart
Fastrestart
Diffstat (limited to 'src/afl-performance.c')
-rw-r--r-- | src/afl-performance.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/afl-performance.c b/src/afl-performance.c index e8ece6b5..b824fd35 100644 --- a/src/afl-performance.c +++ b/src/afl-performance.c @@ -99,11 +99,13 @@ inline u64 hash64(u8 *key, u32 len, u64 seed) { u64 get_binary_hash(u8 *fn) { + if (!fn) { return 0; } int fd = open(fn, O_RDONLY); if (fd < 0) { PFATAL("Unable to open '%s'", fn); } struct stat st; if (fstat(fd, &st) < 0) { PFATAL("Unable to fstat '%s'", fn); } u32 f_len = st.st_size; + if (!f_len) { return 0; } u8 *f_data = mmap(0, f_len, PROT_READ, MAP_PRIVATE, fd, 0); if (f_data == MAP_FAILED) { PFATAL("Unable to mmap file '%s'", fn); } close(fd); |