Skip to content

Commit

Permalink
bug: fix panic when serde as batching (#750)
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <mrcroxx@outlook.com>
  • Loading branch information
MrCroxx authored Sep 29, 2024
1 parent 7a0a35f commit d49c480
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions foyer-storage/src/large/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ where

let pos = self.len;

if pos + EntryHeader::serialized_len() >= self.buffer.len() {
// Only handle start position overflow. End position overflow will be handled by serde.
return false;
}

let info = match EntrySerializer::serialize(
entry.key(),
entry.value(),
Expand Down

0 comments on commit d49c480

Please sign in to comment.