Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.

Optimize a tiny bit the pipe connections #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pythonfuzz/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def write(self, x):

sys.settrace(tracer.trace)
while True:
buf = child_conn.recv_bytes()
buf = child_conn._recv_bytes().getvalue()
try:
target(buf)
except Exception as e:
Expand All @@ -46,7 +46,7 @@ def write(self, x):
child_conn.send(e)
break
else:
child_conn.send_bytes(b'%d' % tracer.get_coverage())
child_conn._send_bytes(b'%d' % tracer.get_coverage())


class Fuzzer(object):
Expand Down Expand Up @@ -127,7 +127,7 @@ def start(self):
break

buf = self._corpus.generate_input()
parent_conn.send_bytes(bytes(buf))
parent_conn._send_bytes(bytes(buf))
if not parent_conn.poll(self._timeout):
self._p.terminate()
logging.info("=================================================================")
Expand All @@ -136,7 +136,7 @@ def start(self):
break

try:
total_coverage = int(parent_conn.recv_bytes())
total_coverage = int(parent_conn._recv_bytes().getvalue())
except ValueError:
self.write_sample(buf)
break
Expand Down