Skip to content

Segmentation fault in extractor() #1

@geoffjentry

Description

@geoffjentry

Have been observing regular segfaults in an app that uses mutalyzer. Traced it down to this block of code:

  while (sample_end - i - 1 > sample_start && sample[sample_end - i - 1] == MASK)
  {
    ++i;
  } // while

I was observing circumstances where sample_start and sample_end were both 0. sample_end - I - 1 overflowed due to being an unsigned int, which then evaluated the LHS to true. Meanwhile the RHS was reading out of bounds memory, which occasionally would wind up being MASK, which led to the segfault.

Will submit a PR to resolve.

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