ITADN

RUSTSEC-2026-0008: Potential undefined behavior when dereferencing Buf struct

#405Closedgithub-actions[bot] 创建于 2026-02-07
| Details | | | --- | --- | | Package | `git2` | | Version | `0.20.3` | | Warning | unsound | | URL | https://github.com/rust-lang/git2-rs/pull/1213 | | Patched Versions | >=0.20.4 | | Aliases | [GHSA-j39j-6gw9-jw6h](https://github.com/advisories/GHSA-j39j-6gw9-jw6h) | 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.
关闭于 2026-02-07 0 条评论