Skip to content

Commit

Permalink
catch JSON decode error
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDavid committed Jul 28, 2023
1 parent fa263a0 commit b393f07
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pastisbroker/coverage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
import json
import time
import logging
import tempfile
Expand Down Expand Up @@ -173,13 +174,15 @@ def coverage_worker(self):

# Remove the coverage file
os.unlink(cov_file)

except json.JSONDecodeError:
item.replay_status = "FAIL_PARSE_COV"
os.unlink(cov_file)
self.seeds_accepted += 1
if item.fuzzer_name != "INITIAL": # if not initial corpus add it
self.granted_queue.put(item)

except FileNotFoundError:
if item.seed_status == SeedType.INPUT:
pass
# logging.warning(f"seed {item.hash}({item.seed_status}) can't load coverage file (maybe had crashed?)")
else:
pass
# logging.info(f"seed {item.hash}({item.seed_status}) cannot get coverage (normal..)")
# Grant input
self.seeds_accepted += 1
if item.fuzzer_name != "INITIAL": # if not initial corpus add it
Expand Down

0 comments on commit b393f07

Please sign in to comment.