Skip to content

Commit

Permalink
Fix missing offset in TBStore read from flash
Browse files Browse the repository at this point in the history
This could cause incomplete data retrieval and mismatch when reading
data in more than one chunk, because every chunk would be read to the
same location at the beginning of the output buffer.
  • Loading branch information
Kyle Kearney committed Aug 23, 2019
1 parent 7455b89 commit 06dd330
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion features/storage/kvstore/tdbstore/TDBStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ int TDBStore::do_reserved_data_get(void *reserved_data, size_t reserved_data_buf

while (actual_size) {
uint32_t chunk = std::min(work_buf_size, (uint32_t) actual_size);
ret = read_area(_active_area, offset, chunk, buf);
ret = read_area(_active_area, offset, chunk, buf + offset);
if (ret) {
return ret;
}
Expand Down

0 comments on commit 06dd330

Please sign in to comment.