Skip to content

Commit fd4be26

Browse files
committed
FIX: Fix potential data corruption in DbnFileStore
1 parent 96a81f3 commit fd4be26

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 0.39.1 - TBD
4+
5+
### Bug fixes
6+
- Fixed potential corrupted data in `DbnFileStore::Replay`
7+
38
## 0.39.0 - 2025-07-15
49

510
### Breaking changes

src/dbn_decoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ const databento::Record* DbnDecoder::DecodeRecord() {
311311
}
312312
}
313313
current_record_ = Record{BufferRecordHeader()};
314-
buffer_.Consume(current_record_.Size());
314+
buffer_.ConsumeNoShift(current_record_.Size());
315315
current_record_ = DbnDecoder::DecodeRecordCompat(
316316
version_, upgrade_policy_, ts_out_, &compat_buffer_, current_record_);
317317
return &current_record_;

src/live_blocking.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,10 @@ const databento::Record* LiveBlocking::NextRecord(
190190
}
191191
current_record_ = Record{BufferRecordHeader()};
192192
const auto bytes_to_consume = current_record_.Size();
193+
buffer_.ConsumeNoShift(bytes_to_consume);
193194
current_record_ =
194195
DbnDecoder::DecodeRecordCompat(version_, upgrade_policy_, send_ts_out_,
195196
&compat_buffer_, current_record_);
196-
// Can't consume til after upgrade as Consume may shift
197-
buffer_.Consume(bytes_to_consume);
198197
return &current_record_;
199198
}
200199

0 commit comments

Comments
 (0)