From e3a552248d9908cf48f4577d860354d01277082d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sat, 23 Oct 2021 21:26:01 +0200 Subject: [PATCH] Make a wrong size of the flashcrc struct an error becuase it might lead to misaligned CRCs in the structure --- stm-firmware/crc-patcher/crc-patch-elf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stm-firmware/crc-patcher/crc-patch-elf.py b/stm-firmware/crc-patcher/crc-patch-elf.py index 9a20386..64e3439 100755 --- a/stm-firmware/crc-patcher/crc-patch-elf.py +++ b/stm-firmware/crc-patcher/crc-patch-elf.py @@ -89,7 +89,8 @@ with open(filename, 'r+b') as f: print('Section for flash CRC missing!') sys.exit(-1) if flashcrc_sec.data_size != 6*4: - print("Warning!!! .flashcrc section has wrong size:",flashcrc_sec.data_size) + print("Error: .flashcrc section has wrong size:",flashcrc_sec.data_size) + sys.exit(-1); crc_sec_data = bytearray(flashcrc_sec.data()) magic1 = struct.unpack('