Skip to content

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

@github-actions

Description

@github-actions
Details
Package git2
Version 0.20.3
Warning unsound
URL rust-lang/git2-rs#1213
Patched Versions >=0.20.4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions