Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: fix None value in find_diffs #74

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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