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
when comparing strings using natural_lexical_cmp, the code can cause a attempt to multiply with overflow panic when the strings contain a number long enough to overflow a u64.
It might be best to just fall back to simple character comparison if a number exceeds a certain length.
The text was updated successfully, but these errors were encountered:
z33ky
added a commit
to z33ky/lexical-sort
that referenced
this issue
Jul 25, 2024
The previous version tried to convert numeric strings to u64 to compare
the values numerically.
This results in a panic if the number exceeds the bounds of u64.
To fix this, numbers are now compared digit-by-digit instead.
Fixessurrealdb/lexicmp#1.
Hi,
when comparing strings using
natural_lexical_cmp
, the code can cause aattempt to multiply with overflow
panic when the strings contain a number long enough to overflow a u64.It might be best to just fall back to simple character comparison if a number exceeds a certain length.
The text was updated successfully, but these errors were encountered: