Skip to content

memrchr uses unaligned loads #35967

Closed
Closed
@bluss

Description

@bluss

Due to an arithmetic error, the fallback memrchr (used for non-linux) in libstd uses unaligned loads, the intention was to produce only well aligned pointers of course.

This was suspected to cause a crash using ARMv7, found by @tomaka

Original code also had the same issue: BurntSushi/memchr/pull/9

I believe that on x86 non-linux platforms, the bug was harmless and the function still produced the correct return value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions