Skip to content

Commit 024a88a

Browse files
committed
Fixes AFLplusplus#464 winepath path translation for .cur_input.
1 parent 4a51cb7 commit 024a88a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

afl-wine-trace

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ else:
6868
argv = sys.argv[1:]
6969
for i in range(len(argv)):
7070
if ".cur_input" in argv[i]:
71-
argv[i] = subprocess.run([os.path.join(os.path.dirname(wine_path), "winepath"), "--windows", argv[i]], universal_newlines=True, stdout=subprocess.PIPE).stdout
71+
# Get the Wine translated path using the winepath tool
72+
arg_translated = subprocess.run([os.path.join(os.path.dirname(wine_path), "winepath"), "--windows", argv[i]], universal_newlines=True, stdout=subprocess.PIPE).stdout
73+
# Remove the spurious LF at the end of the path
74+
if len(arg_translated) > 0 and arg_translated[-1] == '\n':
75+
arg_translated = arg_translated[:-1]
76+
argv[i] = arg_translated
7277
break
7378

7479
print("[afl-wine-trace] exec:", " ".join([qemu_path, wine_path] + argv))

0 commit comments

Comments
 (0)