aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/atom.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-09-01 14:39:52 +0200
committerSverker Eriksson <[email protected]>2017-09-01 14:39:52 +0200
commit50da40f8404969b5a1533026d49e2e2669ffadff (patch)
tree89da7d6933847bd94153cf51025c44afe1e8463e /erts/emulator/beam/atom.c
parent31f236eb808f24fc0dc1ac71313b284dbdd84e0e (diff)
parent44a83c8860bbd00878c720a7b9d940b4630bab8a (diff)
downloadotp-50da40f8404969b5a1533026d49e2e2669ffadff.tar.gz
otp-50da40f8404969b5a1533026d49e2e2669ffadff.tar.bz2
otp-50da40f8404969b5a1533026d49e2e2669ffadff.zip
Merge branch 'sverker/20/binary_to_atom-utf8-crash/ERL-474/OTP-14590' into maint
* sverker/20/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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/atom.c b/erts/emulator/beam/atom.c
index c2d78aaccb..38e02c386f 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--;
}