Advisory

RUSTSEC-2026-0183

Also known as: None

Summary

Potential undefined behavior when calling Remote::list()

Details

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.

Severity

Not rated by the source.

Dates

Published
2026-05-12 12:00 UTC
Modified
2026-06-17 13:00 UTC

Affected packages and fixes

git2

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.21.0 (semver)

Fixed versions

0.21.0

Fix

  • Fixed version 0.21.0
    cargo update -p git2 --precise 0.21.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences