Skip to content

Commit

Permalink
Added target cycling to the main fuzz loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ttufts committed Aug 21, 2023
1 parent 1fd06f9 commit 2988c85
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions boofuzz/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import zlib
from builtins import input
from io import open
from itertools import cycle

from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
Expand Down Expand Up @@ -1391,7 +1392,7 @@ def _main_fuzz_loop(self, fuzz_case_iterator):

self.num_cases_actually_fuzzed = 0
self.start_time = time.time()
for mutation_context in fuzz_case_iterator:
for mutation_context, target in zip(fuzz_case_iterator, cycle(self.targets)):
if self.total_mutant_index < self._index_start:
continue

Expand All @@ -1402,8 +1403,7 @@ def _main_fuzz_loop(self, fuzz_case_iterator):
and self.num_cases_actually_fuzzed % self.restart_interval == 0
):
self._fuzz_data_logger.open_test_step("restart interval of %d reached" % self.restart_interval)
for target in self.targets:
self._restart_target(target)
self._restart_target(target)

self._fuzz_current_case(mutation_context, target)

Expand Down Expand Up @@ -1755,7 +1755,7 @@ def _fuzz_current_case(self, mutation_context, target):
current_message=node,
)
mutation_context.protocol_session = protocol_session
callback_data = self._callback_current_node(node=node, edge=e, test_case_context=protocol_session)
callback_data = self._callback_current_node(target=target, node=node, edge=e, test_case_context=protocol_session)
self._fuzz_data_logger.open_test_step("Transmit Prep Node '{0}'".format(node.name))
self.transmit_normal(target, node, e, callback_data=callback_data, mutation_context=mutation_context)

Expand All @@ -1767,7 +1767,7 @@ def _fuzz_current_case(self, mutation_context, target):
)
mutation_context.protocol_session = protocol_session
callback_data = self._callback_current_node(
node=self.fuzz_node, edge=mutation_context.message_path[-1], test_case_context=protocol_session
target=target, node=self.fuzz_node, edge=mutation_context.message_path[-1], test_case_context=protocol_session
)
self._fuzz_data_logger.open_test_step("Fuzzing Node '{0}'".format(self.fuzz_node.name))
self.transmit_fuzz(
Expand Down

0 comments on commit 2988c85

Please sign in to comment.