diff options
author | John Högberg <[email protected]> | 2019-05-14 13:34:40 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-05-14 13:34:40 +0200 |
commit | 53b76a3b2c1ce19f2eb85d1b788e3c09958fd18a (patch) | |
tree | d098da4b6e89449705ab1a268241de7755138ba9 /erts/emulator/test/bif_SUITE.erl | |
parent | 6618ce7b6a621e92db72ea4f01f7d38553c8818c (diff) | |
parent | 529aec04776dcead1eb7b7fe3ff975d7538cfa5b (diff) | |
download | otp-53b76a3b2c1ce19f2eb85d1b788e3c09958fd18a.tar.gz otp-53b76a3b2c1ce19f2eb85d1b788e3c09958fd18a.tar.bz2 otp-53b76a3b2c1ce19f2eb85d1b788e3c09958fd18a.zip |
Merge branch 'john/erts/fix-xxx_to_existing_atom-overflow/ERL-944/OTP-15819' into maint
* john/erts/fix-xxx_to_existing_atom-overflow/ERL-944/OTP-15819:
erts: Fix buffer overflow in xxx_to_existing_atom
Diffstat (limited to 'erts/emulator/test/bif_SUITE.erl')
-rw-r--r-- | erts/emulator/test/bif_SUITE.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl index 43975d1800..c5abd04e07 100644 --- a/erts/emulator/test/bif_SUITE.erl +++ b/erts/emulator/test/bif_SUITE.erl @@ -612,6 +612,16 @@ binary_to_existing_atom(Config) when is_list(Config) -> UnlikelyAtom = binary_to_atom(id(UnlikelyBin), latin1), UnlikelyAtom = binary_to_existing_atom(UnlikelyBin, latin1), + + %% ERL-944; a binary that was too large would overflow the latin1-to-utf8 + %% conversion buffer. + OverflowAtom = <<0:511/unit:8, + 196, 133, 196, 133, 196, 133, 196, 133, 196, 133, + 196, 133, 196, 133, 196, 133, 196, 133, 196, 133, + 196, 133, 196, 133, 196, 133, 196, 133, 196, 133, + 196, 133, 196, 133, 196, 133, 196, 133, 196, 133>>, + {'EXIT', _} = (catch binary_to_existing_atom(OverflowAtom, latin1)), + ok. |