From bfcd01b89068466858435fb5a11226d1e46749f7 Mon Sep 17 00:00:00 2001 From: Hiroyuki OYAMA Date: Tue, 15 Apr 2025 20:21:23 +0900 Subject: [PATCH] Fix boundary check error in tdbstore causing `kv_set` failure with max area size --- storage/kvstore/tdbstore/source/TDBStore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/kvstore/tdbstore/source/TDBStore.cpp b/storage/kvstore/tdbstore/source/TDBStore.cpp index 8522ffbbdc7..ba6055217b1 100644 --- a/storage/kvstore/tdbstore/source/TDBStore.cpp +++ b/storage/kvstore/tdbstore/source/TDBStore.cpp @@ -292,7 +292,7 @@ int TDBStore::read_record(uint8_t area, uint32_t offset, char *key, return MBED_ERROR_INVALID_DATA_DETECTED; } - if (offset + total_size >= _size) { + if (offset + total_size > _size) { return MBED_ERROR_INVALID_DATA_DETECTED; }