{"id":"RUSTSEC-2026-0183","aliases":["RUSTSEC-2026-0183"],"related":[],"kind":"vulnerability","state":"published","title":"Potential undefined behavior when calling Remote::list()","summary":"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.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"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.","format":"markdown","source":"rustsec"}],"published":"2026-05-12T12:00:00.000Z","modified":"2026-06-17T13:00:04.696Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.21.0"}],"ecosystem":"crates.io","package":"git2","purl":"pkg:cargo/git2","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/git2","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0183.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/rust-lang/git2-rs/pull/1250","tags":["web"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0183","url":"https://rustsec.org/advisories/RUSTSEC-2026-0183.html","licence":"CC0-1.0","modified":"2026-06-17T13:00:04.696Z"}],"updatedAt":"2026-11-25T22:56:43.372Z"}