Skip to content

Commit d34a6cf

Browse files
committed
cpatch: fix trailing input hash
Update the input file iteration to include the very last sliding window in the input file data hash. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent ddb5a60 commit d34a6cf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/infuse_iot/cpatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def _naive_diff(cls, old: bytes, new: bytes, hash_len: int = 8):
506506
# Pre-hash original image
507507
pre_hash = {}
508508
prev_val = None
509-
for offset in range(len(old) - hash_len):
509+
for offset in range(len(old) - hash_len + 1):
510510
val = old[offset : offset + hash_len]
511511
if val == prev_val:
512512
continue

0 commit comments

Comments
 (0)