fix(management): guard against IndexOutOfRangeException in HandleRemove for K8SNS/K8SCluster alias parsing#77
Open
spbsoluble wants to merge 8 commits intorelease-1.2from
Open
fix(management): guard against IndexOutOfRangeException in HandleRemove for K8SNS/K8SCluster alias parsing#77spbsoluble wants to merge 8 commits intorelease-1.2from
spbsoluble wants to merge 8 commits intorelease-1.2from
Conversation
…ve for K8SNS/K8SCluster alias parsing HandleRemove accessed splitAlias[^2] without a bounds check for both K8SNS and K8SCluster store types. A bare alias without the expected '/' delimiter produced a single-element array, causing 'Index was outside the bounds of the array'. Added Length < 2 guard for K8SNS and Length < 3 guard for K8SCluster; returns a clear FailJob with an actionable error message describing the expected alias format.
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.
Summary
HandleRemoveaccessedsplitAlias[^2]without a bounds check for both K8SNS and K8SCluster store types. A bare alias without the expected/delimiter produces a single-element array, causingIndex was outside the bounds of the array.Length < 2guard for K8SNS beforesplitAlias[^2]/splitAlias[^1]Length < 3guard for K8SCluster beforesplitAlias[^2]/splitAlias[^1]/splitAlias[0]Note: the equivalent bug in
HandleCreateOrUpdate(namespace case) was already fixed in 1.2.2. This PR covers only the remainingHandleRemovegap.Test plan
secrets/opaque/secret-name) succeeds