Skip to content

Conversation

@bgamari
Copy link
Contributor

@bgamari bgamari commented Jun 7, 2020

Previously Data.Vector.Algorithms.Intro.partialSort k v would
stumble upon undefined behavior via out-of-range array accesses
if length v < k. Avoid this by clamping k to the length of the
region being sorted.

This bug can result in segmentation faults and other terrible things.
Consequently, it would be good to release this fix quickly.

Previously `Data.Vector.Algorithms.Intro.partialSort k v` would
stumble upon undefined behavior via out-of-range array accesses
if `length v < k`. Avoid this by clamping k to the length of the
region being sorted.
@erikd erikd merged commit 5d761e0 into erikd:master Dec 6, 2020
@erikd
Copy link
Owner

erikd commented Dec 6, 2020

Thanks @bgamari !

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