Skip to content

Commit 0a108e0

Browse files
authored
Improve invalid data case in tdbstore ram init
1 parent 31d05b3 commit 0a108e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/storage/kvstore/tdbstore/TDBStore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ int TDBStore::build_ram_table()
938938
offset = _master_record_offset;
939939

940940
while (offset < _free_space_offset) {
941-
if (offset == next_offset) {
941+
if ((offset + sizeof(record_header_t)) >= _free_space_offset) {
942942
ret = MBED_ERROR_INVALID_DATA_DETECTED;
943943
goto end;
944944
}

0 commit comments

Comments
 (0)