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.
Have been observing regular segfaults in an app that uses mutalyzer. Traced it down to this block of code:
I was observing circumstances where
sample_startandsample_endwere both 0.sample_end - I - 1overflowed due to being an unsigned int, which then evaluated the LHS totrue. Meanwhile the RHS was reading out of bounds memory, which occasionally would wind up beingMASK, which led to the segfault.Will submit a PR to resolve.