cloudfoundry/credhub

Using CredHub CLI to set a credential with special characters in its name causes segfault

Closed this issue · 1 comments

$ ./credhub --version
CLI Version: 0.3.0
CM Version: 0.3.0 build DEV

$ ./credhub set -n '%.)' -v 123
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x4f814b]
goroutine 1 [running]:
panic(0x698000, 0xc42000e090)
        /usr/local/Cellar/go/1.7.1/libexec/src/runtime/panic.go:500 +0x1a1
github.com/pivotal-cf/credhub-cli/client.newRequest(0x6e2a18, 0x3, 0xc4200aabe0, 0x16, 0xc4200aac00, 0x1c, 0xc420079680, 0x411, 0xc4200ca420, 0x22, ...)
        /Users/pivotal/go/src/github.com/pivotal-cf/credhub-cli/client/requests.go:207 +0x10b
github.com/pivotal-cf/credhub-cli/client.newSecretRequest(0x6e2a18, 0x3, 0xc4200aabe0, 0x16, 0xc4200aac00, 0x1c, 0xc420079680, 0x411, 0xc4200ca420, 0x22, ...)
        /Users/pivotal/go/src/github.com/pivotal-cf/credhub-cli/client/requests.go:191 +0xfe
github.com/pivotal-cf/credhub-cli/client.NewPutPasswordRequest(0xc4200aabe0, 0x16, 0xc4200aac00, 0x1c, 0xc420079680, 0x411, 0xc4200ca420, 0x22, 0x1, 0x7ffebeb9b995, ...)
        /Users/pivotal/go/src/github.com/pivotal-cf/credhub-cli/client/requests.go:34 +0x197
github.com/pivotal-cf/credhub-cli/commands.getRequest(0x7ffebeb9b995, 0x3, 0x6e3dc0, 0x8, 0x7ffebeb9b99c, 0x3, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/pivotal/go/src/github.com/pivotal-cf/credhub-cli/commands/set.go:67 +0x513
github.com/pivotal-cf/credhub-cli/commands.SetCommand.Execute(0x7ffebeb9b995, 0x3, 0x6e3dc0, 0x8, 0x7ffebeb9b99c, 0x3, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/pivotal/go/src/github.com/pivotal-cf/credhub-cli/commands/set.go:48 +0x238
github.com/pivotal-cf/credhub-cli/commands.(*SetCommand).Execute(0x837ce0, 0xc4200445f0, 0x0, 0x5, 0x1, 0x0)
        <autogenerated>:11 +0xb9
github.com/pivotal-cf/credhub-cli/vendor/github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc42000a2a0, 0xc42000a130, 0x5, 0x5, 0xc42006c090, 0xc42000a2a0, 0x7ffebeb9b986, 0x0, 0x0)
        /Users/pivotal/go/src/github.com/pivotal-cf/credhub-cli/vendor/github.com/jessevdk/go-flags/parser.go:314 +0x8e6
github.com/pivotal-cf/credhub-cli/vendor/github.com/jessevdk/go-flags.(*Parser).Parse(0xc42000a2a0, 0x837ca0, 0x2, 0xc42000a2a0, 0x0, 0x0)
        /Users/pivotal/go/src/github.com/pivotal-cf/credhub-cli/vendor/github.com/jessevdk/go-flags/parser.go:185 +0x74
main.main()
        /Users/pivotal/go/src/github.com/pivotal-cf/credhub-cli/main.go:16 +0x6d

This issue has been resolved in our development builds and will be in the next (0.4.0) release.

jah:~ djahner$ credhub set -n '%.)' -v 123
Type:          password
Name:          %.)
Value:         123
Updated:       2016-12-08T18:47:51Z
jah:~ djahner$ credhub get -n '%.)'
Type:          password
Name:          %.)
Value:         123
Updated:       2016-12-08T18:47:51Z