Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix out of bounds access in spline interpolation #544

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

vyasr
Copy link
Contributor

@vyasr vyasr commented Jun 1, 2022

The cubic spline API supports fitting many splines at once. Each spline's coefficients are stored on construction of the CubicSpline object, and when users specify a set of points at which to evaluate that spline they can specify which spline to evaluate for each of the input points. When a user does not specify that information, the call operator defaults to assuming that only a single spline exists and interpolates all the data using that spline by setting all input points to use spline 0. Currently, however, the code for creating that default list only makes it as long as the number of knots in the spline instead of making it as long as the set of input points to evaluate the spline at. This leads to out of bounds memory accesses when that curve is fit.

@vyasr vyasr added bug Something isn't working 3 - Ready for Review Ready for review by team Python Related to Python code labels Jun 1, 2022
@vyasr vyasr self-assigned this Jun 1, 2022
@vyasr vyasr requested a review from a team as a code owner June 1, 2022 00:50
@vyasr vyasr requested a review from thomcom June 1, 2022 00:50
@vyasr vyasr added the non-breaking Non-breaking change label Jun 1, 2022
@harrism
Copy link
Member

harrism commented Jun 1, 2022

Thanks Vyas!

@harrism
Copy link
Member

harrism commented Jun 1, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit c149e17 into rapidsai:branch-22.06 Jun 1, 2022
@vyasr vyasr deleted the fix/spline_out_of_bounds branch July 24, 2022 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working non-breaking Non-breaking change Python Related to Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants