Repository navigation
Conversation
…d77magref parse() stored the Dst value in a buffer that was only allocated later, and skipped the leading minus sign when converting. With several input records a numeric -D also read past the one-element dst array. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
MGD77_cm4field freed it on that error, so the next single-record segment wrote into a NULL pointer. Free_Ctrl now owns the buffer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude analyzed
mgd77magrefand found a few bugs around the Dst buffer that lead to crashes. This PR proposes the fix. The scripts below show them (on current master the first three segfault; the last one segfaults after the error for the bad segment).-D<number>segfaults:parse()wrote the value intoCM4_D.dstbefore it was allocated (it is allocated later in the module body).-D-8behaved as-D8: the leading-was skipped beforeatof.-Dread past the end of its 1-elementdstarray.dstinMGD77_cm4field, so the next single-record segment wrote into a NULL pointer.dstis now allocated at parse time and freed only inFree_Ctrl. Addstest/mgd77/magref_dst.sh.Tested with:
Written with Claude Sonnet 5.5, reviewed with Claude Opus 5.5.
This is the output with this fix: