about summary refs log tree commit diff
path: root/src/afl-fuzz-init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/afl-fuzz-init.c')
-rw-r--r--src/afl-fuzz-init.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/afl-fuzz-init.c b/src/afl-fuzz-init.c
index 54760744..102c0f15 100644
--- a/src/afl-fuzz-init.c
+++ b/src/afl-fuzz-init.c
@@ -1157,18 +1157,22 @@ void perform_dry_run(afl_state_t *afl) {
 
 #ifndef SIMPLE_FILES
 
-          snprintf(crash_fn, PATH_MAX, "%s/crashes/id:%06llu,sig:%02u,%s%s",
+          snprintf(crash_fn, PATH_MAX, "%s/crashes/id:%06llu,sig:%02u,%s%s%s%s",
                    afl->out_dir, afl->saved_crashes, afl->fsrv.last_kill_signal,
                    describe_op(afl, 0,
                                NAME_MAX - strlen("id:000000,sig:00,") -
                                    strlen(use_name)),
-                   use_name);
+                   use_name,
+                   afl->file_extension ? "." : "",
+                   afl->file_extension ? (const char*)afl->file_extension : "");
 
 #else
 
-          snprintf(crash_fn, PATH_MAX, "%s/crashes/id_%06llu_%02u",
+          snprintf(crash_fn, PATH_MAX, "%s/crashes/id_%06llu_%02u%s%s",
                    afl->out_dir, afl->saved_crashes,
-                   afl->fsrv.last_kill_signal);
+                   afl->fsrv.last_kill_signal,
+                   afl->file_extension ? "." : "",
+                   afl->file_extension ? (const char*)afl->file_extension : "");
 
 #endif
 
@@ -1439,7 +1443,9 @@ void pivot_inputs(afl_state_t *afl) {
       u32 src_id;
 
       afl->resuming_fuzz = 1;
-      nfn = alloc_printf("%s/queue/%s", afl->out_dir, rsl);
+      nfn = alloc_printf("%s/queue/%s%s%s", afl->out_dir, rsl,
+                         afl->file_extension ? "." : "",
+                         afl->file_extension ? (const char*)afl->file_extension : "");
 
       /* Since we're at it, let's also get the parent and figure out the
          appropriate depth for this entry. */
@@ -1479,12 +1485,16 @@ void pivot_inputs(afl_state_t *afl) {
 
       }
 
-      nfn = alloc_printf("%s/queue/id:%06u,time:0,execs:%llu,orig:%s",
-                         afl->out_dir, id, afl->fsrv.total_execs, use_name);
+      nfn = alloc_printf("%s/queue/id:%06u,time:0,execs:%llu,orig:%s%s%s",
+                         afl->out_dir, id, afl->fsrv.total_execs, use_name,
+                         afl->file_extension ? "." : "",
+                         afl->file_extension ? (const char*)afl->file_extension : "");
 
 #else
 
-      nfn = alloc_printf("%s/queue/id_%06u", afl->out_dir, id);
+      nfn = alloc_printf("%s/queue/id_%06u%s%s", afl->out_dir, id,
+                         afl->file_extension ? "." : "",
+                         afl->file_extension ? (const char*)afl->file_extension : "");
 
 #endif                                                    /* ^!SIMPLE_FILES */