Skip to content

Commit 3e8d663

Browse files
committed
Fix integer
1 parent 2fc808f commit 3e8d663

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

python/unicornafl/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,17 @@ def uc_afl_fuzz(uc: Uc,
126126
_validate_crash_cb), UC_AFL_VALIDATE_CRASH_CB)
127127

128128
if isinstance(input_file, str):
129-
input_file = ctypes.create_string_buffer(input_file.encode('utf-8'))
129+
input_file = \
130+
ctypes.cast(
131+
ctypes.create_string_buffer(input_file.encode('utf-8')),
132+
ctypes.c_void_p
133+
).value
130134
elif isinstance(input_file, bytes):
131-
input_file = ctypes.create_string_buffer(input_file)
135+
input_file = \
136+
ctypes.cast(
137+
ctypes.create_string_buffer(input_file),
138+
ctypes.c_void_p
139+
).value
132140
elif input_file is None:
133141
input_file = 0
134142
else:

0 commit comments

Comments
 (0)