OpenRCE / sulley

A pure-python fully automated and unattended fuzzing framework.
GNU General Public License v2.0
1.42k stars 338 forks source link

Fixed procmon bug from refactor #94

Open jtpereyda opened 9 years ago

jtpereyda commented 9 years ago

Fixed bug introduced by refactor. Sulley would indicate that a target failed to restart, even when it didn't.

Session.restart_target is used (by poll_pedrpc) as if it returns True or False. It actually returned None or False.

In master, sulley/sessions.py line 705 revision 54bdbbebdc2348a0c845d8425027f5557d05d515

            if self.restart_target(target, stop_first=False) == False:
                self.logger.critical("Restarting the target failed, exiting.")
                ...

In sulley_refactor, sulley/sessions.py line 673 revision 256c21d47624b67d44f28926ac905a5f8d58b93c

            if not self.restart_target(target, stop_first=False):
                self.logger.critical("Restarting the target failed, exiting.")
                ...

The problem is that restart_target never returned True if it succeeded. It returned None. This worked before, since None == False is False. But not None is True. I updated restart_target to return True if it succeeds.

>>> None == False
False
>>> not None
True