Skip to content

Commit 86e88b1

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 83408d3 commit 86e88b1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

keepkeylib/transport_dylib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ def __init__(self, dylib_path):
9696

9797
# Allocate flash as 0xFF (erased NOR state). Held by the singleton so
9898
# GC doesn't free it underneath the firmware's still-live mlock.
99-
self.flash = (ctypes.c_uint8 * FLASH_SIZE)(*([0xFF] * FLASH_SIZE))
99+
self.flash = (ctypes.c_uint8 * FLASH_SIZE)()
100+
ctypes.memset(self.flash, 0xFF, FLASH_SIZE)
100101

101102
rc = self.lib.kkemu_init(ctypes.cast(self.flash, ctypes.c_void_p), FLASH_SIZE)
102103
if rc != 0:

0 commit comments

Comments
 (0)