Skip to content

Buffer.Memmove has unaligned casts #83709

@xtqqczze

Description

@xtqqczze

#26654 (comment):

It is invalid to reinterpret cast a ref byte to a ref ushort/uint/ulong without first checking the alignment of the input buffer. This could cause problems on future architectures or IOT devices where unaligned reads incur faults. This code should pin and check alignment or should use Unsafe.WriteUnaligned instead.

cc:@GrabYourPitchforks

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Runtimebugin-prThere is an active PR which will close this issue when it is merged

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions