aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/bif_SUITE.erl
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-05-14 13:34:40 +0200
committerJohn Högberg <[email protected]>2019-05-14 13:34:40 +0200
commit53b76a3b2c1ce19f2eb85d1b788e3c09958fd18a (patch)
treed098da4b6e89449705ab1a268241de7755138ba9 /erts/emulator/test/bif_SUITE.erl
parent6618ce7b6a621e92db72ea4f01f7d38553c8818c (diff)
parent529aec04776dcead1eb7b7fe3ff975d7538cfa5b (diff)
downloadotp-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.erl10
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.