diff options
author | Sverker Eriksson <[email protected]> | 2013-05-06 18:13:16 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-05-06 18:13:33 +0200 |
commit | 8e00f4ce7a49b2fd1da7e481dc0985703e4131a5 (patch) | |
tree | 8a8ffdda6447d9ae3cfb71007c31763f37f73932 /erts/emulator/beam/external.c | |
parent | ea3024202d8dfedfafa62a15286157d3843957cb (diff) | |
parent | 76ae102a243aa05df79dde1f2639542147ec4b44 (diff) | |
download | otp-8e00f4ce7a49b2fd1da7e481dc0985703e4131a5.tar.gz otp-8e00f4ce7a49b2fd1da7e481dc0985703e4131a5.tar.bz2 otp-8e00f4ce7a49b2fd1da7e481dc0985703e4131a5.zip |
Merge branch 'sverk/fix-alloc-fixes' into maint
* sverk/fix-alloc-fixes:
erts: Remove unnecessary utf8 analysis step in external decoding
erts: Fix locking order violation for allocation wrappers
erts: Change locking order for "port_table" and "port_sched_lock"
erts: Adjust sizes for fix allocator
erts: Fix unabused bug in fixed allocation
erts: Fix benign size-bug for fix-allocators MONITOR_SH and NLINK_SH
erts: Refactor in new struct ErtsAllctrFixDDBlock_t
OTP-11085
Diffstat (limited to 'erts/emulator/beam/external.c')
-rw-r--r-- | erts/emulator/beam/external.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c index 5ce0d97c74..8420cfae24 100644 --- a/erts/emulator/beam/external.c +++ b/erts/emulator/beam/external.c @@ -3147,17 +3147,6 @@ encode_size_struct2(ErtsAtomCacheMap *acmp, Eterm obj, unsigned dflags) return result; } -static int is_valid_utf8_atom(byte* bytes, Uint nbytes) -{ - byte* err_pos; - Uint num_chars; - - /*SVERK Do we really need to validate correct utf8? */ - return nbytes <= MAX_ATOM_SZ_LIMIT - && erts_analyze_utf8(bytes, nbytes, &err_pos, &num_chars, NULL) == ERTS_UTF8_OK - && num_chars <= MAX_ATOM_CHARACTERS; -} - static Sint decoded_size(byte *ep, byte* endp, int internal_tags) { @@ -3235,7 +3224,7 @@ decoded_size(byte *ep, byte* endp, int internal_tags) CHKSIZE(2); n = get_int16(ep); ep += 2; - if (!is_valid_utf8_atom(ep, n)) { + if (n > MAX_ATOM_SZ_LIMIT) { return -1; } SKIP(n+atom_extra_skip); @@ -3254,7 +3243,7 @@ decoded_size(byte *ep, byte* endp, int internal_tags) CHKSIZE(1); n = get_int8(ep); ep++; - if (!is_valid_utf8_atom(ep, n)) { + if (n > MAX_ATOM_SZ_LIMIT) { return -1; } SKIP(n+atom_extra_skip); |