diff options
author | John Högberg <[email protected]> | 2019-05-13 09:20:44 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-05-13 14:11:47 +0200 |
commit | 529aec04776dcead1eb7b7fe3ff975d7538cfa5b (patch) | |
tree | 36e9f13f31dbf76f19d9edc885cd1455d6926916 /erts/emulator/test | |
parent | a113f6117fd696ea6f84ed754055b4ec97a7ccb2 (diff) | |
download | otp-529aec04776dcead1eb7b7fe3ff975d7538cfa5b.tar.gz otp-529aec04776dcead1eb7b7fe3ff975d7538cfa5b.tar.bz2 otp-529aec04776dcead1eb7b7fe3ff975d7538cfa5b.zip |
erts: Fix buffer overflow in xxx_to_existing_atom
Diffstat (limited to 'erts/emulator/test')
-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 04b7f2de15..b9d078ff99 100644 --- a/erts/emulator/test/bif_SUITE.erl +++ b/erts/emulator/test/bif_SUITE.erl @@ -592,6 +592,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. |