aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/misc
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-01-24 16:14:04 +0100
committerLukas Larsson <[email protected]>2013-01-25 10:21:51 +0100
commitd4170d92cca6256b8390222f09101e1c121becf9 (patch)
treef60c376cca7e9c049fe1f35e91930ca02da7ceab /lib/erl_interface/src/misc
parentbe062ca7528b3267a6ef08653b001913fc12ae8e (diff)
downloadotp-d4170d92cca6256b8390222f09101e1c121becf9.tar.gz
otp-d4170d92cca6256b8390222f09101e1c121becf9.tar.bz2
otp-d4170d92cca6256b8390222f09101e1c121becf9.zip
Validate UTF8/ASCII when buf is NULL
Diffstat (limited to 'lib/erl_interface/src/misc')
-rw-r--r--lib/erl_interface/src/misc/ei_x_encode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/erl_interface/src/misc/ei_x_encode.c b/lib/erl_interface/src/misc/ei_x_encode.c
index 44dcff7664..f46118830e 100644
--- a/lib/erl_interface/src/misc/ei_x_encode.c
+++ b/lib/erl_interface/src/misc/ei_x_encode.c
@@ -217,7 +217,8 @@ int ei_x_encode_atom_len_as(ei_x_buff* x, const char* s, int len,
enum erlang_char_encoding to_enc)
{
int i = x->index;
- ei_encode_atom_len_as(NULL, &i, s, len, from_enc, to_enc);
+ if (ei_encode_atom_len_as(NULL, &i, s, len, from_enc, to_enc) == -1)
+ return -1;
if (!x_fix_buff(x, i))
return -1;
return ei_encode_atom_len_as(x->buff, &x->index, s, len, from_enc, to_enc);