[PATCH 10/13] fs: bpkfs: make room for the NUL after the checksum string
Sascha Hauer
s.hauer at pengutronix.de
Wed Nov 18 06:52:00 PST 2026
The .crc file of each image holds its checksum as 8 hex digits, which
bpkfs prints into an 8-byte array with sprintf(), so the terminating
NUL is written behind it, into the list head following it in struct
bpkfs_handle_data. It's overwritten right after by adding the entry to
the list, so this went unnoticed.
Make the array 9 bytes. The file still is the 8 digits without the NUL.
Fixes: 2f677b9b1ed5 ("fs: add BPKFS support")
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
include/bpkfs.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/bpkfs.h b/include/bpkfs.h
index 252cee90a6..9a12f5a1ba 100644
--- a/include/bpkfs.h
+++ b/include/bpkfs.h
@@ -50,7 +50,8 @@ struct bpkfs_handle_data {
size_t pos; /* pos in the data */
uint32_t crc;
- char data[8];
+ /* the checksum of the data as 8 hex digits for .crc files */
+ char data[9];
struct list_head list;
};
--
2.47.3
More information about the barebox
mailing list