hashicorp / go-secure-stdlib

Mozilla Public License 2.0
64 stars 24 forks source link

bug(parseutil): SafeParseIntSlice leading zeros #40

Closed cipherboy closed 2 years ago

cipherboy commented 2 years ago

Due to creating a slice with the specified number of elements (rather than a capacity hint), SafeParseIntSlice returned a slice with leading zeros of length greater than was passed, rather than the correct value.

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>


Of course, the one function I didn't test has the bug... Thanks to @Gabrielopesantos in https://github.com/hashicorp/vault/pull/15561 for catching this!

@sgmiller We'll need to bump this in Vault on both 1.12.x and 1.11.x.

sgmiller commented 2 years ago

1.12.x will happen naturally, but make sure to create a PR to update the deps for 1.11.