diff --git a/changelog/14523.txt b/changelog/14523.txt new file mode 100644 index 000000000..f3147315f --- /dev/null +++ b/changelog/14523.txt @@ -0,0 +1,3 @@ +```release-note:bug +cli: Fix panic caused by parsing key=value fields whose value is a single backslash +``` diff --git a/command/kv_test.go b/command/kv_test.go index 6c12ba77a..1738b0593 100644 --- a/command/kv_test.go +++ b/command/kv_test.go @@ -141,6 +141,12 @@ func TestKVPutCommand(t *testing.T) { []string{"== Secret Path ==", "kv/data/write/foo"}, 0, }, + { + "v2_single_value_backslash", + []string{"kv/write/foo", "foo=\\"}, + []string{"== Secret Path ==", "kv/data/write/foo"}, + 0, + }, } for _, tc := range cases { diff --git a/go.mod b/go.mod index d80e0bc57..a1e7d9c1c 100644 --- a/go.mod +++ b/go.mod @@ -73,7 +73,7 @@ require ( github.com/hashicorp/go-secure-stdlib/awsutil v0.1.5 github.com/hashicorp/go-secure-stdlib/base62 v0.1.2 github.com/hashicorp/go-secure-stdlib/gatedwriter v0.1.1 - github.com/hashicorp/go-secure-stdlib/kv-builder v0.1.1 + github.com/hashicorp/go-secure-stdlib/kv-builder v0.1.2 github.com/hashicorp/go-secure-stdlib/mlock v0.1.2 github.com/hashicorp/go-secure-stdlib/parseutil v0.1.3 github.com/hashicorp/go-secure-stdlib/password v0.1.1 diff --git a/go.sum b/go.sum index 480c75e08..824b10a36 100644 --- a/go.sum +++ b/go.sum @@ -879,6 +879,8 @@ github.com/hashicorp/go-secure-stdlib/gatedwriter v0.1.1 h1:9um9R8i0+HbRHS9d64kd github.com/hashicorp/go-secure-stdlib/gatedwriter v0.1.1/go.mod h1:6RoRTSMDK2H/rKh3P/JIsk1tK8aatKTt3JyvIopi3GQ= github.com/hashicorp/go-secure-stdlib/kv-builder v0.1.1 h1:IJgULbAXuvWxzKFfu+Au1FUmHIJulS6N4F7Hkn+Kck0= github.com/hashicorp/go-secure-stdlib/kv-builder v0.1.1/go.mod h1:rf5JPE13wi+NwjgsmGkbg4b2CgHq8v7Htn/F0nDe/hg= +github.com/hashicorp/go-secure-stdlib/kv-builder v0.1.2 h1:NS6BHieb/pDfx3M9jDdaPpGyyVp+aD4A3DjX3dgRmzs= +github.com/hashicorp/go-secure-stdlib/kv-builder v0.1.2/go.mod h1:rf5JPE13wi+NwjgsmGkbg4b2CgHq8v7Htn/F0nDe/hg= github.com/hashicorp/go-secure-stdlib/mlock v0.1.1/go.mod h1:zq93CJChV6L9QTfGKtfBxKqD7BqqXx5O04A/ns2p5+I= github.com/hashicorp/go-secure-stdlib/mlock v0.1.2 h1:p4AKXPPS24tO8Wc8i1gLvSKdmkiSY5xuju57czJ/IJQ= github.com/hashicorp/go-secure-stdlib/mlock v0.1.2/go.mod h1:zq93CJChV6L9QTfGKtfBxKqD7BqqXx5O04A/ns2p5+I=