You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of Validate for the constraints Length and CharCount might panic. The limits are of type u32 and to perform the checks the limit values are casted to usize. If an actual value does not fit into usize it will panic. This might be the case on 16bit or 8bit targets.
The text was updated successfully, but these errors were encountered:
A solution will be to change the type of the limit parameters from u32 to usize. There is one small issue with this solution though. In case of a constraint violations the actual value and the expected value should be converted to Value. This conversion is needed to include the parameters in the ValidationError, or more precisly in the InvalidValue struct.
usize can not be converted to Value for values that are greater than i64::max_value(). To overcome this we can implement TryFrom<usize> for Value and include this parameters only if the convertion is successful.
The current implementation of
Validate
for the constraintsLength
andCharCount
might panic. The limits are of typeu32
and to perform the checks the limit values are casted tousize
. If an actual value does not fit into usize it will panic. This might be the case on 16bit or 8bit targets.The text was updated successfully, but these errors were encountered: