Skip to content

copy_nonoverlapping panics on zero-sized NULL ptr copy #131371

Closed
@RalfJung

Description

@RalfJung

We somewhat recently declared copy_nonoverlapping to be legal on a NULL pointer. However, the debug assertions still reject this:

ub_checks::is_aligned_and_not_null(src, align)
&& ub_checks::is_aligned_and_not_null(dst, align)
&& ub_checks::is_nonoverlapping(src, dst, size, count)

Other, related functions have similar problems.

Cc @saethlin

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions