diff options
author | Erlang/OTP <[email protected]> | 2017-11-15 14:39:57 +0100 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2017-11-15 14:39:57 +0100 |
commit | f84f3547d4f47ba8c6b5bcf7c032cbc96f59fda0 (patch) | |
tree | 27a8790bf9ae9d65f894830a7fc867edaf61697d /erts/emulator/beam | |
parent | 7ca3c4e7a37c71a327feaec60128329b48e51436 (diff) | |
parent | 97dc5e7f396129222419811c173edc7fa767b0f8 (diff) | |
download | otp-f84f3547d4f47ba8c6b5bcf7c032cbc96f59fda0.tar.gz otp-f84f3547d4f47ba8c6b5bcf7c032cbc96f59fda0.tar.bz2 otp-f84f3547d4f47ba8c6b5bcf7c032cbc96f59fda0.zip |
Merge branch 'sverker/r16/binary_to_atom-utf8-crash/ERL-474/OTP-14590' into maint-18
* sverker/r16/binary_to_atom-utf8-crash/ERL-474/OTP-14590:
erts: Fix crash in binary_to_atom/term for invalid utf8
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/atom.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/atom.c b/erts/emulator/beam/atom.c index fe91134ef4..13412821f5 100644 --- a/erts/emulator/beam/atom.c +++ b/erts/emulator/beam/atom.c @@ -138,7 +138,7 @@ atom_hash(Atom* obj) while(len--) { v = *p++; /* latin1 clutch for r16 */ - if ((v & 0xFE) == 0xC2 && (*p & 0xC0) == 0x80) { + if (len && (v & 0xFE) == 0xC2 && (*p & 0xC0) == 0x80) { v = (v << 6) | (*p & 0x3F); p++; len--; } |