fix: update mvdan/sh, remove fixed-upstream panic guards#146
Merged
Conversation
… guard Update mvdan.cc/sh/v3 to v3.13.1-0.20260326 which fixes: - Non-ASCII glob panic (pattern.go regexp.MustCompile crash) - U+FFFD and control char glob panics - Nameref array append panic (vars.go unhandled Kind) Remove litHasUnsafeChars and declHasUnsafeNameref from nodeHasUnsafe — these are now safe and caught by the general defer/recover fallback. Add guard for test -N / [ -N / [[ -N ]] which panics with "unhandled unary test op: -N" (test.go:215, still unfixed upstream).
6093a5b to
cb9d9c4
Compare
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
mvdan.cc/sh/v3tov3.13.1-0.20260326which fixes non-ASCII glob panic (pattern.go rune-based lexer), U+FFFD/control char glob panics, and nameref array append panic (vars.go resolve fix)litHasUnsafeCharsanddeclHasUnsafeNamereffromnodeHasUnsafe— fixed upstream, now caught by generaldefer/recovertest -N/[ -N/[[ -N ]]which panics with "unhandled unary test op: -N" (still unfixed upstream)Test plan
go test -short ./internal/rules/— all passFuzzParseShellCommands— 30s, 542K execs, no panicsFuzzExtractBashCommand— 30s, no panicsFuzzEngineBypass— 30s, no panicsFuzzNormalAgentFalsePositive— 30s, no panicsecho ŀ*,declare -n ref=arr; ref+=(x)no longer panictest -N /tmp,[[ -N /tmp ]]caught by new guard