Skip to content

Prevent out of bounds memory read#2

Open
geoffjentry wants to merge 1 commit intomutalyzer:masterfrom
geoffjentry:jg_resolve_segfault
Open

Prevent out of bounds memory read#2
geoffjentry wants to merge 1 commit intomutalyzer:masterfrom
geoffjentry:jg_resolve_segfault

Conversation

@geoffjentry
Copy link
Copy Markdown

Resolves #1

typedef size_t array[2][reference_length];
array &LCS_line = *(reinterpret_cast<array*>(new size_t[2 * reference_length]));
array &LCS_line_rc = *(reinterpret_cast<array*>(new size_t[2 * reference_length]));
array &LCS_line = *(reinterpret_cast<array*>(new size_t[2 * reference_length]()));
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I don't believe these are necessary but noticed it when trying to track down the actual error

sample_start += i;
i = 0;
while (sample_end - i - 1 > sample_start && sample[sample_end - i - 1] == MASK)
while (i + 1 < sample_end - sample_start && sample[sample_end - i - 1] == MASK)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It also occurs to me that just above this diff is another example of the same bug with reference_end. Seems a lot less likely to trigger (perhaps 0%?), but I'll try to remember to push an update w/ that patched as well

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.

Segmentation fault in extractor()

1 participant