Skip to content

Commit

Permalink
remove global fz
Browse files Browse the repository at this point in the history
  • Loading branch information
xmendez committed Apr 26, 2019
1 parent 73307b5 commit b84f051
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/wfuzz/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __init__(self, **kwargs):
self.cache = HttpCache()
self.http_pool = None

self.fz = None
self.stats = FuzzStats()

def _defaults(self):
Expand Down Expand Up @@ -210,16 +209,17 @@ def payload(self, **kwargs):
def fuzz(self, **kwargs):
self.data.update(kwargs)

fz = None
try:
self.fz = Fuzzer(self.compile())
fz = Fuzzer(self.compile())

for f in self.fz:
for f in fz:
yield f

finally:
if self.fz:
self.fz.cancel_job()
self.stats.update(self.fz.genReq.stats)
if fz:
fz.cancel_job()
self.stats.update(fz.genReq.stats)

def get_payloads(self, iterator):
self.data["dictio"] = iterator
Expand Down Expand Up @@ -303,6 +303,3 @@ def compile(self):
def close(self):
if self.http_pool:
self.http_pool.deregister()

if self.fz:
self.fz.cancel_job()

0 comments on commit b84f051

Please sign in to comment.