Skip to content

Commit

Permalink
use strconv.IntSize
Browse files Browse the repository at this point in the history
  • Loading branch information
e-asphyx committed Nov 28, 2024
1 parent 663a1b5 commit 7a7eca6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/vault/pkcs11/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,10 @@ func New(config *Config) (*PKCS11Vault, error) {
if config.Slot != nil {
slot = *config.Slot
} else if s := os.Getenv(envSlot); s != "" {
v, err := strconv.ParseUint(s, 0, 64)
v, err := strconv.ParseUint(s, 0, strconv.IntSize)
if err != nil {
return nil, formatError(mod, err)
}
if v > uint64(^uint(0)) {
return nil, fmt.Errorf("(PKCS#11/%s): slot value exceeds maximum uint size", path.Base(lib))
}
slot = uint(v)
} else if slot, err = findSlot(mod); err != nil {
return nil, err
Expand Down

0 comments on commit 7a7eca6

Please sign in to comment.