t-digest icon indicating copy to clipboard operation
t-digest copied to clipboard

Fix Centroid Count OOM Crash

Open domhauton opened this issue 6 years ago • 1 comments

When passing in data with a very high centroid count the code creates an array of the requested size. If the data is malformed or invalid, this can lead to very large data structures being created that cause the application to run out of memory and crash.

This change performs a sanity check before deserialising a AVLTree to confirm the requested number of centroids is lower or equal to the amount of data remaining in the buffer.

domhauton avatar Dec 10 '18 16:12 domhauton

Double checked all of the failing tests in CI, none are related to the code change made.

domhauton avatar Dec 11 '18 11:12 domhauton