-
-
Notifications
You must be signed in to change notification settings - Fork 355
lib/arraystats: re-enable "Discont" algorithm #5529
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
Conversation
7d89f25
to
19ed7ef
Compare
I have compared the results of the updated/fixed "discontinuities" algorithm against the results from the original Fortran code and they are consistent. I don't have the knowledge to evaluate the algorithm as such but it works as intended (with reference to the original author). So, this part will probably be difficult to review. However, I'd be happy to receive review on the general workings of @mlennert A big thank you for your assistance, which was crucial for this fix. |
56393d5
to
5cb06bd
Compare
Addresses heap buffer overflow in previously disabled 'Discont' algorithm. The immediate cause was too small allocation of variable `num` in `AS_class_discont()`, which was fixed by an increase of its size (broadly mirroring the original Fortran code). This fix was complemented by some code related improvements: - Code clean up and restructure of `AS_class_discont()` - Re-enable "dis" algorithm in v.class and d.vect.thematic - Pass `classbreaks` array by pointer to pointer to enable in- and output. See: https://lists.osgeo.org/pipermail/grass-dev/2008-July/038951.html Fixes: OSGeo#5486
5cb06bd
to
7d42ec3
Compare
Was the Fortran source available publicly? If so, can you link it here for perennity? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving here in order to not block you, if it never gets reviewed thoroughly. I don't see how I could find something wrong with the process you used to fix that old time issue.
To my knowledge, it is not. |
If there are no objections I'll go ahead and merge this soon. I'm fairy confident this will not break anything, so let it be tested live. |
This will need a renewed approval, I did some (foremost) stylistic changes. |
What does Are the changes in the function signature insignificant for the public API/ABI? Does a note need to be prepared for the next release, or these changes are "source-compatible", ie work without changes to code using it, just rebuild? |
It informs both compiler and user (see const type). Compiler may enforce, and even optimise.
API is practically the same, in the unlikely case the library is used in any addon it shouldn’t be any issue. |
Thanks Edouard! |
Addresses heap buffer overflow in previously disabled 'Discont' algorithm.
The immediate cause was too small allocation of variable
num
inAS_class_discont()
, which was fixed by an increase of its size (broadly mirroring the original Fortran code).This fix was complemented by some code related improvements:
AS_class_discont()
classbreaks
array by pointer to pointer to enable in- and output.For this PR I had the original Fortran code at my disposal.
See: https://lists.osgeo.org/pipermail/grass-dev/2008-July/038951.html
Fixes: #5486