diff options
author | Erlang/OTP <[email protected]> | 2018-10-11 21:08:36 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2018-10-11 21:08:36 +0200 |
commit | 909517755e78f4bdc385c451f851f4499e0a163c (patch) | |
tree | 0f54e4bb8459c7a984375f3697cc71d1caf3cee7 /erts/emulator/beam/atom.c | |
parent | 1af9112d7fed1f3fb2cd1d05fb200d813c8ff3d3 (diff) | |
parent | 97dc5e7f396129222419811c173edc7fa767b0f8 (diff) | |
download | otp-909517755e78f4bdc385c451f851f4499e0a163c.tar.gz otp-909517755e78f4bdc385c451f851f4499e0a163c.tar.bz2 otp-909517755e78f4bdc385c451f851f4499e0a163c.zip |
Merge branch 'sverker/r16/binary_to_atom-utf8-crash/ERL-474/OTP-14590' into maint-17
* 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/atom.c')
-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 84d2d5e3ed..f95582d1ab 100644 --- a/erts/emulator/beam/atom.c +++ b/erts/emulator/beam/atom.c @@ -137,7 +137,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--; } |