Skip to content

std::mem::find_sequence/find_sequence_in_range/find_string_in_range fails when sequence exists across read block boundaries #159

@matkinsuva

Description

@matkinsuva

Hello,

As in title, the code linked below appears to search through the data in blocks of 4K bytes.

for (u64 offset = offsetFrom; offset < offsetTo; offset += bytes.size()) {

If the sequence spans two blocks, then the function will miss it.

I am seeing what could be the effect of this where if I change the start offset value the find_string_in_range function will return -1 or the actual position.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions