These proposed variants allow parsing smaller data types (such as ints)
from larger data types (the int64 returned by ParseInt{,Slice}(...)),
validating that they are within the requested range prior to casting.
With the SafeParseIntRange(...) helper, we also allow validation of the
maximum expected number of elements in the slice.
Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
These proposed variants allow parsing smaller data types (such as
int
s) from larger data types (theint64
returned byParseInt{,Slice}(...)
), validating that they are within the requested range prior to casting. With theSafeParseIntRange(...)
helper, we also allow validation of the maximum expected number of elements in the slice.Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
--
https://hashicorp.atlassian.net/browse/VAULT-3892 has some context around this change for those with access.