Skip to content

Commit

Permalink
liblk: Use the patch size rather than the sequence size
Browse files Browse the repository at this point in the history
  • Loading branch information
R0rt1z2 committed Oct 4, 2023
1 parent 399c7ee commit a216c59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion liblk/LkImage.py
Expand Up @@ -92,7 +92,7 @@ def apply_patch(self, needle: str | bytes | bytearray, patch: str | bytes | byte
if offset != -1:
# Replace the needle with the patch. We don't need to worry about the length of the
# patch, since maybe the user wants to replace a 4-byte needle with a 1-byte patch.
self.lk_contents[offset:offset + len(needle)] = patch
self.lk_contents[offset:offset + len(patch)] = patch
else:
raise NeedleNotFoundException(needle)

Expand Down

0 comments on commit a216c59

Please sign in to comment.