diff options
author | Sverker Eriksson <[email protected]> | 2013-05-06 21:04:38 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-05-06 21:04:38 +0200 |
commit | a38dde7003ea204979985e6784a4559e8123a66e (patch) | |
tree | a97511ad3b5bb39aece2893302f056f1b2f2d929 /erts/emulator/beam/external.c | |
parent | 22f01b438963ac158af3d8066e58ce54be22d2de (diff) | |
parent | 8e00f4ce7a49b2fd1da7e481dc0985703e4131a5 (diff) | |
download | otp-a38dde7003ea204979985e6784a4559e8123a66e.tar.gz otp-a38dde7003ea204979985e6784a4559e8123a66e.tar.bz2 otp-a38dde7003ea204979985e6784a4559e8123a66e.zip |
Merge branch 'maint'
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); |