diff options
author | Sverker Eriksson <[email protected]> | 2017-08-30 19:53:37 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-08-30 20:21:10 +0200 |
commit | 97dc5e7f396129222419811c173edc7fa767b0f8 (patch) | |
tree | 636fd537cd1634a04176d635183668efa64c3650 /erts/emulator/test/bif_SUITE.erl | |
parent | 8cece79b77952c991e62ae595bcf71cde016a052 (diff) | |
download | otp-97dc5e7f396129222419811c173edc7fa767b0f8.tar.gz otp-97dc5e7f396129222419811c173edc7fa767b0f8.tar.bz2 otp-97dc5e7f396129222419811c173edc7fa767b0f8.zip |
erts: Fix crash in binary_to_atom/term for invalid utf8
such as a sub-binary, of a correct utf8 string,
that ends in the middle of a character.
Diffstat (limited to 'erts/emulator/test/bif_SUITE.erl')
-rw-r--r-- | erts/emulator/test/bif_SUITE.erl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl index 02c6de8cb1..dd1949d041 100644 --- a/erts/emulator/test/bif_SUITE.erl +++ b/erts/emulator/test/bif_SUITE.erl @@ -482,6 +482,9 @@ binary_to_atom(Config) when is_list(Config) -> ?line ?BADARG(binary_to_atom(id(<<255>>), utf8)), ?line ?BADARG(binary_to_atom(id(<<255,0>>), utf8)), ?line ?BADARG(binary_to_atom(id(<<16#C0,16#80>>), utf8)), %Overlong 0. + <<B:1/binary, _/binary>> = id(<<194, 163>>), %Truncated character ERL-474 + ?BADARG(binary_to_atom(B, utf8)), + ?line [?BADARG(binary_to_atom(<<C/utf8>>, utf8)) || C <- lists:seq(256, 16#D7FF)], ?line [?BADARG(binary_to_atom(<<C/utf8>>, utf8)) || |