From c08ff09f0f453bf7f26dff33bd7d0f2726ca3a3b Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sun, 6 Sep 2015 21:14:23 +0300 Subject: [PATCH] storage: add compile-time assert for sizeof(Storage) validation --- firmware/storage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/storage.c b/firmware/storage.c index a3e2f84ac2..d5f5bc9f9d 100644 --- a/firmware/storage.c +++ b/firmware/storage.c @@ -39,6 +39,7 @@ #include "protect.h" #include "layout2.h" +_Static_assert(sizeof(Storage) <= FLASH_STORAGE_LEN, "Storage struct is too large for TREZOR flash"); Storage storage; uint8_t storage_uuid[12];