Skip to content

Commit

Permalink
Merge pull request #74 from Wenzel/fix/havoc_none
Browse files Browse the repository at this point in the history
util: fix None value in find_diffs
  • Loading branch information
Wenzel authored Jan 5, 2024
2 parents 38be982 + e8b617c commit a05b7a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kafl_fuzzer/common/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ def read_binary_file(filename) -> bytes:
return f.read()

def find_diffs(data_a: bytes, data_b: bytes) -> Tuple[Optional[int], Optional[int]]:
first_diff = None
last_diff = None
first_diff = 0
last_diff = 0
for i in range(min(len(data_a), len(data_b))):
if data_a[i] != data_b[i]:
if first_diff is None:
if first_diff == 0:
first_diff = i
last_diff = i
return first_diff, last_diff
Expand Down

0 comments on commit a05b7a6

Please sign in to comment.