Skip to content

Conversation

@weihanglo
Copy link
Member

Fixes #1211

@rustbot rustbot added the S-waiting-on-review Status: Waiting on review label Jan 31, 2026
Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I pushed up a small test, too.

@ehuss ehuss enabled auto-merge February 1, 2026 15:49
@ehuss ehuss added this pull request to the merge queue Feb 1, 2026
Merged via the queue into rust-lang:master with commit 9e160f1 Feb 1, 2026
7 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Waiting on review label Feb 1, 2026
ehuss added a commit that referenced this pull request Feb 2, 2026
pbeza added a commit to near/mpc that referenced this pull request Feb 4, 2026
Fixes:

```
[cargo-make] INFO - Execute Command: "cargo" "shear"
Analyzing /home/runner/work/mpc/mpc

No unused dependencies!
[cargo-make] INFO - Running Task: cargo-deny
[cargo-make] INFO - Execute Command: "cargo" "deny" "--all-features" "check"
error[unsound]: Potential undefined behavior when dereferencing Buf struct
┌─ /home/runner/work/mpc/mpc/Cargo.lock:278:1
│
278 │ git2 0.20.2 registry+https://github.com/rust-lang/crates.io-index
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ unsound advisory detected
│
├ ID: RUSTSEC-2026-0008
├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0008
├ if we dereference the Buf struct right after calling new() or default() on Buf struct, it passes Null Pointer to the unsafe function slice::from_raw_parts. Based on the safety section documentation of function,
data must be non-null and aligned even for zero-length slices or slices of ZSTs. Thus, passing Null Pointer will lead to undefined behavior.
├ Announcement: rust-lang/git2-rs#1213
├ Solution: Upgrade to >=0.20.4 (try cargo update -p git2)
├ git2 v0.20.2
└── built v0.8.0
└── (build) mpc-node v3.4.0
└── backup-cli v3.4.0

advisories FAILED, bans ok, licenses ok, sources ok
```
This was referenced Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential null pointer dereference with Deref implementation on Buf

3 participants