aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2017-10-05 16:58:15 +0200
committerErlang/OTP <[email protected]>2017-10-05 16:58:15 +0200
commit2484c5b486fc0db61d26c1b67b7770776342ce59 (patch)
treea5ae35bce54fde4e4895748aae84915b523eb11e /erts/emulator/beam
parent567e5a7f9261d753a4b4f44706fea6400b8a855c (diff)
parent7c67bbddb53c364086f66260701bc54a61c9659c (diff)
downloadotp-2484c5b486fc0db61d26c1b67b7770776342ce59.tar.gz
otp-2484c5b486fc0db61d26c1b67b7770776342ce59.tar.bz2
otp-2484c5b486fc0db61d26c1b67b7770776342ce59.zip
Merge branch 'sverker/19/binary_to_atom-utf8-crash/ERL-474/OTP-14590' into maint-19
* sverker/19/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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/atom.c b/erts/emulator/beam/atom.c
index 2052afe52b..e7a655b60f 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--;
}