Validate shell-controlled array indices - #161
Open
PhysicistJohn wants to merge 1 commit into
Open
Conversation
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.
Problem
Several shell arguments reached array or menu traversal operations without a
complete lower/upper bound check. Negative trace samples and palette IDs,
invalid trace copy/subtract destinations, out-of-range marker references, and
negative/overlong remote-menu paths could address outside their valid objects.
Change
Add checks immediately before the affected operations:
available menu items.
Valid command syntax, one-based public trace/marker numbering, and menu layout
remain unchanged.
Verification
-fanalyzerreports no analyzer diagnostic.initialization counts.
V0.5.4, MAX2871), and its embedded version was verified before testing.
and invalid marker-trace indices, palette IDs -1 and 32, and remote-menu paths
-1 and 9999. All 32 palette rows were unchanged afterward.
The physical test uses only invalid indices, compares the palette before and
after, and confirms the shell remains responsive.