aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2023-04-25 13:13:43 +0200
committervanhauser-thc <vh@thc.org>2023-04-25 13:13:43 +0200
commitd822181467ec41f1ee2d840c3c5b1918c72ffc86 (patch)
tree58caccbe65d817c69db954f97009430e965b52c2 /src
parentbc969f78f634035abf88bc73a5076848660901e7 (diff)
downloadAFLplusplus-d822181467ec41f1ee2d840c3c5b1918c72ffc86.tar.gz
afl-cmin -T support
Diffstat (limited to 'src')
-rw-r--r--src/afl-showmap.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index 09a1d2dc..d0e01cb1 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -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[strlen(fn2) - 1] == '\r' || fn2[strlen(fn2) - 1] == '\n' ||
- fn2[strlen(fn2) - 1] == ' ') {
-
- fn2[strlen(fn2) - 1] = 0;
+ while (*fn2 &&
+ (fn2[strlen(fn2) - 1] == '\r' || fn2[strlen(fn2) - 1] == '\n' ||
+ fn2[strlen(fn2) - 1] == ' ')) {
- }
+ 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); }