{"id":"RUSTSEC-2026-0183","aliases":[],"status":"published","title":"Potential undefined behavior when calling Remote::list()","description":"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.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"published":"2026-05-12T12:00:00Z","modified":"2026-06-17T13:00:04Z","fixes":[{"ecosystem":"crates.io","package":"git2","fixed_in":["0.21.0"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"crates.io","package":"git2","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.21.0"}]}]}],"references":[{"url":"https://crates.io/crates/git2","tags":["package"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0183.html","tags":["advisory"]},{"url":"https://github.com/rust-lang/git2-rs/pull/1250","tags":["web"]}],"sources":{"osv":[{"id":"RUSTSEC-2026-0183","title":"Potential undefined behavior when calling Remote::list()","description":"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.","status":"published","published":"2026-05-12T12:00:00Z","modified":"2026-06-17T13:00:04.696626611Z","updated_at":"2026-11-02T15:53:40.430679Z"}]}}
