Skip to content

Conversation

@sotlampr
Copy link

@sotlampr sotlampr commented Oct 31, 2025

In the inner loop, if simplified.size() == 0 then segmentsize = simplified.size()-1 wraps around to max int. Subsequently we enter the loop with the j < segmentsize condition and get a segmentation fault .

This PR skips the inner loop altogether ifsimplified.size() == 0.

segmentsize = simplified.size();

for (int j = 0; j < segmentsize; j++)
if (segmentsize == 0)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably this should be <=1, as we access simplified[j+1] in the loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant