afl-cmin -T support

This commit is contained in:
vanhauser-thc
2023-04-25 13:13:43 +02:00
parent bc969f78f6
commit d822181467
3 changed files with 125 additions and 45 deletions

View File

@ -894,9 +894,7 @@ u32 execute_testcases_filelist(u8 *fn) {
while (fgets(buf, sizeof(buf), f) != NULL) {
struct stat st;
u8 *fn2 = buf, *fn3;
;
u8 *fn2 = buf, *fn3;
while (*fn2 == ' ') {
@ -904,14 +902,11 @@ u32 execute_testcases_filelist(u8 *fn) {
}
if (*fn2) {
while (*fn2 &&
(fn2[strlen(fn2) - 1] == '\r' || fn2[strlen(fn2) - 1] == '\n' ||
fn2[strlen(fn2) - 1] == ' ')) {
while (fn2[strlen(fn2) - 1] == '\r' || fn2[strlen(fn2) - 1] == '\n' ||
fn2[strlen(fn2) - 1] == ' ') {
fn2[strlen(fn2) - 1] = 0;
}
fn2[strlen(fn2) - 1] = 0;
}
@ -926,6 +921,8 @@ u32 execute_testcases_filelist(u8 *fn) {
}
++done;
if (!S_ISREG(st.st_mode) || !st.st_size) { continue; }
if ((fn3 = strrchr(fn2, '/'))) {
@ -946,9 +943,12 @@ u32 execute_testcases_filelist(u8 *fn) {
}
if (!collect_coverage)
if (!collect_coverage) {
snprintf(outfile, sizeof(outfile), "%s/%s", out_file, fn3);
}
if (read_file(fn2)) {
if (wait_for_gdb) {
@ -961,7 +961,6 @@ u32 execute_testcases_filelist(u8 *fn) {
showmap_run_target_forkserver(fsrv, in_data, in_len);
ck_free(in_data);
++done;
if (child_crashed && debug) { WARNF("crashed: %s", fn2); }