diff --git a/Makefile b/Makefile index 08cb75e7..1442394f 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ # PROGNAME = afl -VERSION = 2.09b +VERSION = 2.10b PREFIX ?= /usr/local BIN_PATH = $(PREFIX)/bin diff --git a/afl-fuzz.c b/afl-fuzz.c index 9cd63e3e..37239dc8 100644 --- a/afl-fuzz.c +++ b/afl-fuzz.c @@ -7133,19 +7133,24 @@ static void get_core_count(void) { #else - /* On Linux, a simple way is to look at /proc/stat, especially since we'd - be parsing it anyway for other reasons later on. */ + if (!cpu_core_count) { - FILE* f = fopen("/proc/stat", "r"); - u8 tmp[1024]; + /* On Linux, a simple way is to look at /proc/stat, especially since we'd + be parsing it anyway for other reasons later on. But do this only if + cpu_core_count hasn't been obtained before as a result of specifying + -Z. */ - if (!f) return; + FILE* f = fopen("/proc/stat", "r"); + u8 tmp[1024]; - while (fgets(tmp, sizeof(tmp), f)) - if (!strncmp(tmp, "cpu", 3) && isdigit(tmp[3])) cpu_core_count++; + if (!f) return; + + while (fgets(tmp, sizeof(tmp), f)) + if (!strncmp(tmp, "cpu", 3) && isdigit(tmp[3])) cpu_core_count++; + + fclose(f); + } - fclose(f); - #endif /* ^(__APPLE__ || __FreeBSD__ || __OpenBSD__) */ if (cpu_core_count) { diff --git a/docs/ChangeLog b/docs/ChangeLog index 1ff69765..45460626 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog @@ -16,6 +16,12 @@ Not sure if you should upgrade? The lowest currently recommended version is 2.07b. If you're stuck on an earlier release, it's strongly advisable to get on with the times. +-------------- +Version 2.10b: +-------------- + + - Fixed a minor core counting glitch, reported by Tyler Nighswander. + -------------- Version 2.09b: --------------