aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2019-05-14 15:27:40 +0200
committerErlang/OTP <[email protected]>2019-05-14 15:27:40 +0200
commit7b9cce213cc303115f37af788e68fb2249418c95 (patch)
tree6bb407e7aaf24601ee035b6d17a898d54df77307 /erts/emulator/test
parent19787959d0f6fd3c580c41fa7dc58d8eb081235e (diff)
parent529aec04776dcead1eb7b7fe3ff975d7538cfa5b (diff)
downloadotp-7b9cce213cc303115f37af788e68fb2249418c95.tar.gz
otp-7b9cce213cc303115f37af788e68fb2249418c95.tar.bz2
otp-7b9cce213cc303115f37af788e68fb2249418c95.zip
Merge branch 'john/erts/fix-xxx_to_existing_atom-overflow/ERL-944/OTP-15819' into maint-21
* 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')
-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 9e7bcd5255..9f6e1059b9 100644
--- a/erts/emulator/test/bif_SUITE.erl
+++ b/erts/emulator/test/bif_SUITE.erl
@@ -609,6 +609,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.