Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

empty string keys cause panic in cue vet #261

Closed
zellyn opened this issue Jan 13, 2020 · 1 comment
Closed

empty string keys cause panic in cue vet #261

zellyn opened this issue Jan 13, 2020 · 1 comment

Comments

@zellyn
Copy link

zellyn commented Jan 13, 2020

~/tmp mkdir cuetest
~/tmp cd cuetest/
~/tmp/cuetest echo '{"":42}' > test.yaml
~/tmp/cuetest echo 'foo?: int' > check.cue
~/tmp/cuetest cue vet test.yaml check.cue 
invalid field name: :
    ./test.yaml:1:3
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x136e2a6]

goroutine 1 [running]:
cuelang.org/go/cmd/cue/cmd.recoverError(0xc000225eb0)
	/Users/mpvl/dev/release/cue/cmd/cue/cmd/root.go:211 +0xa3
panic(0x174a680, 0x1dee000)
	/usr/local/go/src/runtime/panic.go:679 +0x1b2
cuelang.org/go/cue.(*Instance).Value(0x0, 0x1faf3c0, 0xc00025aaf0)
	/Users/mpvl/dev/release/cue/cue/instance.go:190 +0x26
cuelang.org/go/cmd/cue/cmd.vetFiles(0xc00020f9e0, 0xc000101900, 0xc0001e9f60, 0x1, 0x1)
	/Users/mpvl/dev/release/cue/cmd/cue/cmd/vet.go:181 +0x593
cuelang.org/go/cmd/cue/cmd.doVet(0xc00020f9e0, 0xc00020fe40, 0x2, 0x2, 0x0, 0x0)
	/Users/mpvl/dev/release/cue/cmd/cue/cmd/vet.go:99 +0x64b
cuelang.org/go/cmd/cue/cmd.mkRunE.func1(0xc000264500, 0xc00020fe40, 0x2, 0x2, 0x0, 0x0)
	/Users/mpvl/dev/release/cue/cmd/cue/cmd/root.go:46 +0x5f
github.com/spf13/cobra.(*Command).execute(0xc000264500, 0xc00020fde0, 0x2, 0x2, 0xc000264500, 0xc00020fde0)
	/Users/mpvl/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:762 +0x460
github.com/spf13/cobra.(*Command).ExecuteC(0xc00025e500, 0x0, 0xc00020fc80, 0x0)
	/Users/mpvl/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2ea
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/mpvl/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800
cuelang.org/go/cmd/cue/cmd.(*Command).Run(0xc00020f9e0, 0x1930a40, 0xc000034130, 0x0, 0x0)
	/Users/mpvl/dev/release/cue/cmd/cue/cmd/root.go:196 +0x75
cuelang.org/go/cmd/cue/cmd.mainErr(0x1930a40, 0xc000034130, 0xc000030110, 0x3, 0x3, 0x1d9b540, 0xc000062750)
	/Users/mpvl/dev/release/cue/cmd/cue/cmd/root.go:131 +0x74
cuelang.org/go/cmd/cue/cmd.Main(0xc0000400b8)
	/Users/mpvl/dev/release/cue/cmd/cue/cmd/root.go:116 +0x84
main.main()
	/Users/mpvl/dev/release/cue/cmd/cue/main.go:24 +0x22
@cueckoo
Copy link

cueckoo commented Jul 3, 2021

This issue has been migrated to cue-lang/cue#261.

For more details about CUE's migration to a new home, please see cue-lang/cue#1078.

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

No branches or pull requests

2 participants