Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on invalid shell format input #2275

Open
redbaron opened this issue Feb 5, 2025 · 0 comments
Open

crash on invalid shell format input #2275

redbaron opened this issue Feb 5, 2025 · 0 comments
Labels

Comments

@redbaron
Copy link

redbaron commented Feb 5, 2025

Describe the bug
SIGSEGV on invalid shell input format

Version of yq: 4.45.1
Operating system: mac
Installed via: home-brew

Command
The command you ran:

echo 'a\nb' | yq -p shell
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1010847f8]

goroutine 1 [running]:
github.com/mikefarah/yq/v4/cmd.configureDecoder(0x0)
	github.com/mikefarah/yq/v4/cmd/utils.go:118 +0x48
github.com/mikefarah/yq/v4/cmd.evaluateSequence(0x140001c4008, {0x14000156860, 0x0, 0x2})
	github.com/mikefarah/yq/v4/cmd/evaluate_sequence_command.go:112 +0x278
github.com/mikefarah/yq/v4/cmd.New.func1(0x140001c4008?, {0x14000156860?, 0x4?, 0x101086cc9?})
	github.com/mikefarah/yq/v4/cmd/root.go:66 +0x74
github.com/spf13/cobra.(*Command).execute(0x140001c4008, {0x140001183a0, 0x2, 0x2})
	github.com/spf13/cobra@v1.8.1/command.go:985 +0x834
github.com/spf13/cobra.(*Command).ExecuteC(0x140001c4008)
	github.com/spf13/cobra@v1.8.1/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).Execute(0x14000179f38?)
	github.com/spf13/cobra@v1.8.1/command.go:1041 +0x1c
main.main()
	github.com/mikefarah/yq/v4/yq.go:22 +0x1a0

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant