Skip to content

Commit

Permalink
Fix for buffer overflow in fetch_latest_one
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Doyle <[email protected]>
  • Loading branch information
holly sparkles authored and w4 committed Jan 15, 2024
1 parent 584eadf commit 912b88e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/database/schema/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl CommitTree {

pub fn fetch_latest_one(&self) -> Result<Option<YokedCommit>, anyhow::Error> {
let mut key = self.prefix.to_vec();
key.extend_from_slice(&(self.len()? - 1).to_be_bytes());
key.extend_from_slice(&(self.len()?.saturating_sub(1)).to_be_bytes());

let cf = self
.db
Expand Down

0 comments on commit 912b88e

Please sign in to comment.