helm
helm copied to clipboard
Crash on value file with % in its name
Helm crashes whenever file given to the -f option has a % sign in its name. So e.g. helm template -f ../%values.yaml some/chart or helm install -f ../%values.yaml some/chart. The crash produces following backtrace:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x18b40d0]
goroutine 1 [running]:
helm.sh/helm/v3/pkg/cli/values.readFile({0xc0008409b0, 0x1b206c0}, {0xc00053dc40, 0x2, 0x2})
helm.sh/helm/v3/pkg/cli/values/options.go:118 +0x70
helm.sh/helm/v3/pkg/cli/values.(*Options).MergeValues(0xc000517f20, {0xc00053dc40, 0xc00089f9f8, 0xc0001840e0})
helm.sh/helm/v3/pkg/cli/values/options.go:48 +0x385
main.runInstall({0xc00053cac0, 0x2bc, 0xc00089fac0}, 0xc0004a8dc0, 0x2000, {0x2026020, 0xc00000e018})
helm.sh/helm/v3/cmd/helm/install.go:198 +0x385
main.newTemplateCmd.func2(0xc000142000, {0xc00053cac0, 0x4, 0x4})
helm.sh/helm/v3/cmd/helm/template.go:82 +0x22a
github.com/spf13/cobra.(*Command).execute(0xc000142000, {0xc00053ca80, 0x4, 0x4})
github.com/spf13/[email protected]/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xc0007dd400)
github.com/spf13/[email protected]/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:902
main.main()
helm.sh/helm/v3/cmd/helm/helm.go:83 +0x234
The problem seems to be that url.Parse in pkg/cli/values/options.go:115 fails when the string contains a % that does not start a valid escape sequence, but its result is not checked.
Output of helm version:
version.BuildInfo{Version:"v3.9.0", GitCommit:"7ceeda6c585217a19a1131663d8cd1f7d641b2a7", GitTreeState:"clean", GoVersion:"go1.17.5"}
@yxxhero I want to do this.
@d-d-up OK. assign to you.
Fixed by PR #11214