[WIP] Fix segfault parsing marker options whose names start with a digit - #2868
Open
bigfooted wants to merge 2 commits into
Open
[WIP] Fix segfault parsing marker options whose names start with a digit#2868bigfooted wants to merge 2 commits into
bigfooted wants to merge 2 commits into
Conversation
COptionStringValuesList and the species-list parser split a marker option into names and values by testing whether the first character is a letter. Mesh formats that auto-generate boundary names routinely produce names that begin with a digit, for example CGNS names such as 4000_QUAD_4_Bdy6. Those were classified as values, so for MARKER_HEATFLUX= ( 4000_QUAD_4_Bdy6, 0.0 ) the very first field took the value branch and called back() on an empty vector, which segfaults. The existing comment already noted the limitation. Classify a field by whether it parses as a number in full instead. That is unambiguous for any name that is not itself purely numeric, and such a name cannot be told apart from a value at all, so it now raises a clear error rather than corrupting memory. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Proposed Changes
boundary condition names cannot start with values, which is pretty common for CGNS meshes.
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.
pre-commit run --allto format old commits.