diff options
author | Frank Hunleth <[email protected]> | 2018-01-03 18:10:12 -0500 |
---|---|---|
committer | Frank Hunleth <[email protected]> | 2018-01-03 20:39:07 -0500 |
commit | 434e4774a4f7e70437ee8a50c7b99ff3bda67282 (patch) | |
tree | 585117a4e067be213694b50ddbf6ef023e9c8c85 /xcomp | |
parent | 93042b54da6a576b187bfb7b2222fc8a5a4d4f12 (diff) | |
download | otp-434e4774a4f7e70437ee8a50c7b99ff3bda67282.tar.gz otp-434e4774a4f7e70437ee8a50c7b99ff3bda67282.tar.bz2 otp-434e4774a4f7e70437ee8a50c7b99ff3bda67282.zip |
Fail if ':' is passed to binary_to_integer/2
Before:
1> binary_to_integer(<<":">>, 16).
3
After:
1> binary_to_integer(<<":">>, 16).
** exception error: bad argument
in function binary_to_integer/2
called as binary_to_integer(<<":">>,16)
Prior to this change, both list_to_integer/2 and binary_to_integer/2
would convert strings with values between ASCII '9' up to '0'+base for
base > 10. For example, when converting in base 16, you could pass ':',
';', '<', '=', '>', and '?' without getting an exception. This was due
to a missing check in c2int_is_invalid_char().
This change adds the missing check and a regression test for passing
':'. It also simplifies the code and tightens up an out-of-bounds check
to make it off-by-one rather than off-by-two.
Diffstat (limited to 'xcomp')
0 files changed, 0 insertions, 0 deletions