Hi,
when I run afl-cmin on a directory with file names that contain spaces, it gets
a little confused:
> $ mkdir input; echo hello > "input/a b"
> $ afl-cmin -Q -m none -i input -o min cat
> corpus minimization tool for afl-fuzz by <
lca...@google.com>
>
> [*] Testing the target binary...
> [+] OK, 171 tuples recorded.
> [*] Obtaining traces for input files in 'input'...
> Processing file 1/1... /usr/bin/afl-cmin: line 305: input/a: No such file or directory
> Processing file 2/1... /usr/bin/afl-cmin: line 305: input/b: No such file or directory
>
> [*] Sorting trace sets (this may take a while)...
> cat: min/.traces/a: No such file or directory
> cat: b: No such file or directory
> [+] Found 0 unique tuples across 1 files.
> [*] Finding best candidates for each tuple...
> Processing file 1/1... sed: can't read min/.traces/a: No such file or directory
> Processing file 2/1... sed: can't read min/.traces/b: No such file or directory
>
> [*] Sorting candidate list (be patient)...
> [-] Error: no traces obtained from test cases, check syntax!
Replacing every
for fn in `ls "$IN_DIR"`; do
with
ls "$IN_DIR" | while read fn; do
makes afl-cmin behave correctly, but might be a little non-idiomatic (maybe).
Setting $IFS to '\n' breaks some other code in afl-cmin.
Cheers,
Jonathan