From 901d0fcb9f220830e080f304be0336c83b7db33c Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Sat, 16 May 2026 15:04:25 -0700 Subject: [PATCH] Add advisory for git2: buffer-created BlameHunk leads to null pointers --- crates/git2/RUSTSEC-0000-0000.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 crates/git2/RUSTSEC-0000-0000.md diff --git a/crates/git2/RUSTSEC-0000-0000.md b/crates/git2/RUSTSEC-0000-0000.md new file mode 100644 index 0000000000..b5503e84d1 --- /dev/null +++ b/crates/git2/RUSTSEC-0000-0000.md @@ -0,0 +1,16 @@ +```toml +[advisory] +id = "RUSTSEC-0000-0000" +package = "git2" +date = "2026-05-13" +url = "https://github.com/rust-lang/git2-rs/pull/1254" +informational = "unsound" +keywords = ["git2"] + +[versions] +patched = ["> 0.20.4"] +``` + +# Potential undefined behavior with Signature from a buffer-created BlameHunk + +When a `Blame` is created via `Blame::blame_buffer()`, and a `BlameHunk` is retrieved, the pointers to the original author, original committer, final author, and final committer may be null if unavailable. The corresponding `BlameHunk` methods then create `Signature`s based on null pointers; attempting to access the data of the `Signature`s leads to dereferencing null pointers.