Skip to content

Fix segfault due to integer overflow in ratio_color indexing#124

Open
tvasenin wants to merge 1 commit into
pyroscope:masterfrom
tvasenin:bugfix/fix-ratio_color-segfault
Open

Fix segfault due to integer overflow in ratio_color indexing#124
tvasenin wants to merge 1 commit into
pyroscope:masterfrom
tvasenin:bugfix/fix-ratio_color-segfault

Conversation

@tvasenin
Copy link
Copy Markdown

@tvasenin tvasenin commented Dec 26, 2019

If the x1000 ratio is large enough (in my case it was 671075384),
you can get negative ratio_color index due to the overflow.

This commit avoids potential overflows inside ratio_color() and also
in all places where it is called.

Previous fix (d52abd2, PR #112)
masked the issue instead of fixing it, and didn't address all cases.

If the x1000 ratio is large enough (in my case it was 671075384),
you can get negative ratio_color index due to the overflow.

This commit avoids potential overflows inside ratio_color() and also
in all places where it is called.

Previous fix (commit d52abd2)
masked the issue instead of fixing it, and didn't address all cases.
@tvasenin tvasenin changed the title Fix segfault due to integer overflow in ratio_color indexing (#112) Fix segfault due to integer overflow in ratio_color indexing Dec 26, 2019
@pyroscope pyroscope self-assigned this Dec 26, 2019
@tvasenin
Copy link
Copy Markdown
Author

@pyroscope Could you pls review and merge this PR?

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.

2 participants