RUSTSEC-2026-0183
not scored yetPotential undefined behavior when calling Remote::list()
When calling Remote::list() for a remote of a git repository, when that remote does not advertise any references, git2 passes a null pointer to the unsafe function slice::from_raw_parts(). Based on the safety section documentation of function, data must be non-null even for slices of length zero. Thus, the use of a null pointer leads to undefined behavior.
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | git2 | >= 0.0.0-0, < 0.21.0 | 0.21.0 |
References
- https://crates.io/crates/git2 · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2026-0183.html · ADVISORY
- https://github.com/rust-lang/git2-rs/pull/1250 · WEB
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 12 May 2026)