add cmplog compatability check

This commit is contained in:
vanhauser-thc
2021-10-31 12:29:45 +01:00
parent e2ca7a6397
commit 639d108512
4 changed files with 22 additions and 144 deletions

View File

@ -342,6 +342,11 @@ static void report_error_and_exit(int error) {
"the fuzzing target reports that the mmap() call to the shared "
"memory failed.");
break;
case FS_ERROR_OLD_CMPLOG:
FATAL(
"the -c cmplog target was instrumented with an too old afl++ "
"version, you need to recompile it.");
break;
default:
FATAL("unknown error code %d from fuzzing target!", error);
@ -651,6 +656,12 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
if ((status & FS_OPT_OLD_AFLPP_WORKAROUND) == FS_OPT_OLD_AFLPP_WORKAROUND)
status = (status & 0xf0ffffff);
if ((status & FS_OPT_NEWCMPLOG) == 0 && fsrv->cmplog_binary) {
report_error_and_exit(FS_ERROR_OLD_CMPLOG);
}
if ((status & FS_OPT_SNAPSHOT) == FS_OPT_SNAPSHOT) {
fsrv->snapshot = 1;