diff options
Diffstat (limited to 'lib/erl_interface/src')
31 files changed, 82 insertions, 64 deletions
diff --git a/lib/erl_interface/src/Makefile b/lib/erl_interface/src/Makefile index 03e2ce14f0..a069aa07ab 100644 --- a/lib/erl_interface/src/Makefile +++ b/lib/erl_interface/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1996-2009. All Rights Reserved. +# Copyright Ericsson AB 1996-2013. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/connect/ei_connect.c b/lib/erl_interface/src/connect/ei_connect.c index 4421bbb7fe..c1361e169e 100644 --- a/lib/erl_interface/src/connect/ei_connect.c +++ b/lib/erl_interface/src/connect/ei_connect.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2000-2011. All Rights Reserved. + * Copyright Ericsson AB 2000-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/connect/ei_connect_int.h b/lib/erl_interface/src/connect/ei_connect_int.h index 81c384e38d..42ab9b58d7 100644 --- a/lib/erl_interface/src/connect/ei_connect_int.h +++ b/lib/erl_interface/src/connect/ei_connect_int.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2010. All Rights Reserved. + * Copyright Ericsson AB 2001-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/connect/ei_resolve.c b/lib/erl_interface/src/connect/ei_resolve.c index 79d259b92d..2545c5f3de 100644 --- a/lib/erl_interface/src/connect/ei_resolve.c +++ b/lib/erl_interface/src/connect/ei_resolve.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1997-2011. All Rights Reserved. + * Copyright Ericsson AB 1997-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/connect/eirecv.c b/lib/erl_interface/src/connect/eirecv.c index 075f78e3d2..1821de3844 100644 --- a/lib/erl_interface/src/connect/eirecv.c +++ b/lib/erl_interface/src/connect/eirecv.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/decode/decode_atom.c b/lib/erl_interface/src/decode/decode_atom.c index 9779ad3f35..af4fc114d1 100644 --- a/lib/erl_interface/src/decode/decode_atom.c +++ b/lib/erl_interface/src/decode/decode_atom.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2011. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/decode/decode_boolean.c b/lib/erl_interface/src/decode/decode_boolean.c index f20690249b..8c44a1ccfc 100644 --- a/lib/erl_interface/src/decode/decode_boolean.c +++ b/lib/erl_interface/src/decode/decode_boolean.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2009. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/decode/decode_fun.c b/lib/erl_interface/src/decode/decode_fun.c index 7bbef5db44..c4667822e5 100644 --- a/lib/erl_interface/src/decode/decode_fun.c +++ b/lib/erl_interface/src/decode/decode_fun.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2009. All Rights Reserved. + * Copyright Ericsson AB 2001-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/decode/decode_pid.c b/lib/erl_interface/src/decode/decode_pid.c index e79952195d..67ce7e05f9 100644 --- a/lib/erl_interface/src/decode/decode_pid.c +++ b/lib/erl_interface/src/decode/decode_pid.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2011. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/decode/decode_port.c b/lib/erl_interface/src/decode/decode_port.c index 5fd96b51a4..2d1b46e705 100644 --- a/lib/erl_interface/src/decode/decode_port.c +++ b/lib/erl_interface/src/decode/decode_port.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2011. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/decode/decode_ref.c b/lib/erl_interface/src/decode/decode_ref.c index 7294e5d239..579371ed7d 100644 --- a/lib/erl_interface/src/decode/decode_ref.c +++ b/lib/erl_interface/src/decode/decode_ref.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2011. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/encode/encode_atom.c b/lib/erl_interface/src/encode/encode_atom.c index 044f17cb60..32f5ae2af1 100644 --- a/lib/erl_interface/src/encode/encode_atom.c +++ b/lib/erl_interface/src/encode/encode_atom.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2011. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -23,8 +23,8 @@ #include "putget.h" -static int copy_ascii_atom(char* dst, const char* src, int slen); -static int copy_utf8_atom(char* dst, const char* src, int slen); +static int verify_ascii_atom(const char* src, int slen); +static int verify_utf8_atom(const char* src, int slen); int ei_encode_atom(char *buf, int *index, const char *p) @@ -73,7 +73,8 @@ int ei_encode_atom_len_as(char *buf, int *index, const char *p, int len, if (len < 0) return -1; break; case ERLANG_ASCII: - if (copy_ascii_atom(s+2, p, len) < 0) return -1; + if (verify_ascii_atom(p, len) < 0) return -1; + memcpy(s+2, p, len); break; case ERLANG_LATIN1: memcpy(s+2, p, len); @@ -88,7 +89,8 @@ int ei_encode_atom_len_as(char *buf, int *index, const char *p, int len, if (from_enc == ERLANG_UTF8) { len = utf8_to_latin1(NULL, p, len, MAXATOMLEN-1, NULL); if (len < 0) return -1; - } + } else if (from_enc == ERLANG_ASCII) + if (verify_ascii_atom(p, len) < 0) return -1; } break; @@ -100,11 +102,13 @@ int ei_encode_atom_len_as(char *buf, int *index, const char *p, int len, len = latin1_to_utf8((buf ? s+offs : NULL), p, len, MAXATOMLEN_UTF8-1, NULL); break; case ERLANG_ASCII: - if (buf && copy_ascii_atom(s+offs, p, len) < 0) return -1; + if (verify_ascii_atom(p, len) < 0) return -1; + if (buf) memcpy(s+offs,p,len); break; case ERLANG_UTF8: if (len >= 256) offs++; - if (buf && copy_utf8_atom(s+offs, p, len) < 0) return -1; + if (verify_utf8_atom(p, len) < 0) return -1; + if (buf) memcpy(s+offs,p,len); break; default: return -1; @@ -144,17 +148,17 @@ ei_internal_put_atom(char** bufp, const char* p, int slen, } -int copy_ascii_atom(char* dst, const char* src, int slen) +int verify_ascii_atom(const char* src, int slen) { while (slen > 0) { if ((src[0] & 0x80) != 0) return -1; - *dst++ = *src++; + src++; slen--; } return 0; } -int copy_utf8_atom(char* dst, const char* src, int slen) +int verify_utf8_atom(const char* src, int slen) { int num_chars = 0; @@ -163,25 +167,22 @@ int copy_utf8_atom(char* dst, const char* src, int slen) if ((src[0] & 0x80) != 0) { if ((src[0] & 0xE0) == 0xC0) { if (slen < 2 || (src[1] & 0xC0) != 0x80) return -1; - *dst++ = *src++; + src++; slen--; } else if ((src[0] & 0xF0) == 0xE0) { if (slen < 3 || (src[1] & 0xC0) != 0x80 || (src[2] & 0xC0) != 0x80) return -1; - *dst++ = *src++; - *dst++ = *src++; + src += 2; slen -= 2; } else if ((src[0] & 0xF8) == 0xF0) { if (slen < 4 || (src[1] & 0xC0) != 0x80 || (src[2] & 0xC0) != 0x80 || (src[3] & 0xC0) != 0x80) return -1; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; + src += 3; slen -= 3; } else return -1; } - *dst++ = *src++; + src++; slen--; } return 0; diff --git a/lib/erl_interface/src/encode/encode_fun.c b/lib/erl_interface/src/encode/encode_fun.c index 4daee32648..455d8a5a94 100644 --- a/lib/erl_interface/src/encode/encode_fun.c +++ b/lib/erl_interface/src/encode/encode_fun.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2009. All Rights Reserved. + * Copyright Ericsson AB 2001-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/encode/encode_pid.c b/lib/erl_interface/src/encode/encode_pid.c index 0cf3ef4efb..903c9cce00 100644 --- a/lib/erl_interface/src/encode/encode_pid.c +++ b/lib/erl_interface/src/encode/encode_pid.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2009. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/encode/encode_port.c b/lib/erl_interface/src/encode/encode_port.c index 2bf9e26d78..c729aeb4eb 100644 --- a/lib/erl_interface/src/encode/encode_port.c +++ b/lib/erl_interface/src/encode/encode_port.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2009. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/encode/encode_ref.c b/lib/erl_interface/src/encode/encode_ref.c index e8b3173315..3511366bef 100644 --- a/lib/erl_interface/src/encode/encode_ref.c +++ b/lib/erl_interface/src/encode/encode_ref.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2009. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/legacy/erl_connect.c b/lib/erl_interface/src/legacy/erl_connect.c index f82704ea8b..eca16497dc 100644 --- a/lib/erl_interface/src/legacy/erl_connect.c +++ b/lib/erl_interface/src/legacy/erl_connect.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2011. All Rights Reserved. + * Copyright Ericsson AB 1996-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/legacy/erl_eterm.c b/lib/erl_interface/src/legacy/erl_eterm.c index aa0fd5ddcf..9e778a299e 100644 --- a/lib/erl_interface/src/legacy/erl_eterm.c +++ b/lib/erl_interface/src/legacy/erl_eterm.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/legacy/erl_eterm.h b/lib/erl_interface/src/legacy/erl_eterm.h index 2e8129d9cd..ca4ec7925a 100644 --- a/lib/erl_interface/src/legacy/erl_eterm.h +++ b/lib/erl_interface/src/legacy/erl_eterm.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2009. All Rights Reserved. + * Copyright Ericsson AB 1996-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/legacy/erl_format.c b/lib/erl_interface/src/legacy/erl_format.c index 533241e396..fda05cbdb8 100644 --- a/lib/erl_interface/src/legacy/erl_format.c +++ b/lib/erl_interface/src/legacy/erl_format.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2011. All Rights Reserved. + * Copyright Ericsson AB 1996-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/legacy/erl_malloc.c b/lib/erl_interface/src/legacy/erl_malloc.c index d09239e02d..c320a00bfe 100644 --- a/lib/erl_interface/src/legacy/erl_malloc.c +++ b/lib/erl_interface/src/legacy/erl_malloc.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2009. All Rights Reserved. + * Copyright Ericsson AB 1996-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c index 4c45cebb02..c051c3a597 100644 --- a/lib/erl_interface/src/legacy/erl_marshal.c +++ b/lib/erl_interface/src/legacy/erl_marshal.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2011. All Rights Reserved. + * Copyright Ericsson AB 1996-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/legacy/global_whereis.c b/lib/erl_interface/src/legacy/global_whereis.c index e6c556d907..589c9d17de 100644 --- a/lib/erl_interface/src/legacy/global_whereis.c +++ b/lib/erl_interface/src/legacy/global_whereis.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2009. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/misc/ei_decode_term.c b/lib/erl_interface/src/misc/ei_decode_term.c index 65afee89cc..1423ec7ed7 100644 --- a/lib/erl_interface/src/misc/ei_decode_term.c +++ b/lib/erl_interface/src/misc/ei_decode_term.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2011. All Rights Reserved. + * Copyright Ericsson AB 2001-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/misc/ei_format.c b/lib/erl_interface/src/misc/ei_format.c index b5f11e618e..07499213cd 100644 --- a/lib/erl_interface/src/misc/ei_format.c +++ b/lib/erl_interface/src/misc/ei_format.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2012. All Rights Reserved. + * Copyright Ericsson AB 2001-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/misc/ei_printterm.c b/lib/erl_interface/src/misc/ei_printterm.c index f3003a6172..95369db15a 100644 --- a/lib/erl_interface/src/misc/ei_printterm.c +++ b/lib/erl_interface/src/misc/ei_printterm.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2010. All Rights Reserved. + * Copyright Ericsson AB 2001-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/misc/ei_x_encode.c b/lib/erl_interface/src/misc/ei_x_encode.c index 44dcff7664..4e6f4a1d36 100644 --- a/lib/erl_interface/src/misc/ei_x_encode.c +++ b/lib/erl_interface/src/misc/ei_x_encode.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2009. All Rights Reserved. + * Copyright Ericsson AB 2001-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -99,7 +99,8 @@ int ei_x_encode_string(ei_x_buff* x, const char* s) int ei_x_encode_string_len(ei_x_buff* x, const char* s, int len) { int i = x->index; - ei_encode_string_len(NULL, &i, s, len); + if (ei_encode_string_len(NULL, &i, s, len) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_string_len(x->buff, &x->index, s, len); @@ -108,7 +109,8 @@ int ei_x_encode_string_len(ei_x_buff* x, const char* s, int len) int ei_x_encode_binary(ei_x_buff* x, const void* p, int len) { int i = x->index; - ei_encode_binary(NULL, &i, p, len); + if (ei_encode_binary(NULL, &i, p, len) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_binary(x->buff, &x->index, p, len); @@ -117,7 +119,8 @@ int ei_x_encode_binary(ei_x_buff* x, const void* p, int len) int ei_x_encode_long(ei_x_buff* x, long n) { int i = x->index; - ei_encode_long(NULL, &i, n); + if (ei_encode_long(NULL, &i, n) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_long(x->buff, &x->index, n); @@ -126,7 +129,8 @@ int ei_x_encode_long(ei_x_buff* x, long n) int ei_x_encode_ulong(ei_x_buff* x, unsigned long n) { int i = x->index; - ei_encode_ulong(NULL, &i, n); + if (ei_encode_ulong(NULL, &i, n) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_ulong(x->buff, &x->index, n); @@ -135,7 +139,8 @@ int ei_x_encode_ulong(ei_x_buff* x, unsigned long n) int ei_x_encode_char(ei_x_buff* x, char p) { int i = x->index; - ei_encode_char(NULL, &i, p); + if (ei_encode_char(NULL, &i, p) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_char(x->buff, &x->index, p); @@ -144,7 +149,8 @@ int ei_x_encode_char(ei_x_buff* x, char p) int ei_x_encode_boolean(ei_x_buff* x, int p) { int i = x->index; - ei_encode_boolean(NULL, &i, p); + if (ei_encode_boolean(NULL, &i, p) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_boolean(x->buff, &x->index, p); @@ -153,7 +159,8 @@ int ei_x_encode_boolean(ei_x_buff* x, int p) int ei_x_encode_double(ei_x_buff* x, double dbl) { int i = x->index; - ei_encode_double(NULL, &i, dbl); + if (ei_encode_double(NULL, &i, dbl) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_double(x->buff, &x->index, dbl); @@ -162,7 +169,8 @@ int ei_x_encode_double(ei_x_buff* x, double dbl) int ei_x_encode_list_header(ei_x_buff* x, long n) { int i = x->index; - ei_encode_list_header(NULL, &i, n); + if (ei_encode_list_header(NULL, &i, n) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_list_header(x->buff, &x->index, n); @@ -171,7 +179,8 @@ int ei_x_encode_list_header(ei_x_buff* x, long n) int ei_x_encode_empty_list(ei_x_buff* x) { int i = x->index; - ei_encode_empty_list(NULL, &i); + if (ei_encode_empty_list(NULL, &i) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_empty_list(x->buff, &x->index); @@ -180,7 +189,8 @@ int ei_x_encode_empty_list(ei_x_buff* x) int ei_x_encode_version(ei_x_buff* x) { int i = x->index; - ei_encode_version(NULL, &i); + if (ei_encode_version(NULL, &i) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_version(x->buff, &x->index); @@ -189,7 +199,8 @@ int ei_x_encode_version(ei_x_buff* x) int ei_x_encode_tuple_header(ei_x_buff* x, long n) { int i = x->index; - ei_encode_tuple_header(NULL, &i, n); + if (ei_encode_tuple_header(NULL, &i, n) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_tuple_header(x->buff, &x->index, n); @@ -217,7 +228,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); @@ -227,7 +239,8 @@ int ei_x_encode_atom_len_as(ei_x_buff* x, const char* s, int len, int ei_x_encode_pid(ei_x_buff* x, const erlang_pid* pid) { int i = x->index; - ei_encode_pid(NULL, &i, pid); + if (ei_encode_pid(NULL, &i, pid) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_pid(x->buff, &x->index, pid); @@ -236,7 +249,8 @@ int ei_x_encode_pid(ei_x_buff* x, const erlang_pid* pid) int ei_x_encode_fun(ei_x_buff* x, const erlang_fun* fun) { int i = x->index; - ei_encode_fun(NULL, &i, fun); + if (ei_encode_fun(NULL, &i, fun) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_fun(x->buff, &x->index, fun); @@ -245,7 +259,8 @@ int ei_x_encode_fun(ei_x_buff* x, const erlang_fun* fun) int ei_x_encode_ref(ei_x_buff* x, const erlang_ref* ref) { int i = x->index; - ei_encode_ref(NULL, &i, ref); + if (ei_encode_ref(NULL, &i, ref) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_ref(x->buff, &x->index, ref); @@ -254,7 +269,8 @@ int ei_x_encode_ref(ei_x_buff* x, const erlang_ref* ref) int ei_x_encode_port(ei_x_buff* x, const erlang_port* port) { int i = x->index; - ei_encode_port(NULL, &i, port); + if (ei_encode_port(NULL, &i, port) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_port(x->buff, &x->index, port); @@ -263,7 +279,8 @@ int ei_x_encode_port(ei_x_buff* x, const erlang_port* port) int ei_x_encode_trace(ei_x_buff* x, const erlang_trace* trace) { int i = x->index; - ei_encode_trace(NULL, &i, trace); + if (ei_encode_trace(NULL, &i, trace) == -1) + return -1; if (!x_fix_buff(x, i)) return -1; return ei_encode_trace(x->buff, &x->index, trace); diff --git a/lib/erl_interface/src/misc/get_type.c b/lib/erl_interface/src/misc/get_type.c index 54465196b0..2bd992bd56 100644 --- a/lib/erl_interface/src/misc/get_type.c +++ b/lib/erl_interface/src/misc/get_type.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/misc/putget.h b/lib/erl_interface/src/misc/putget.h index 77ae168f8c..587bf1a0f8 100644 --- a/lib/erl_interface/src/misc/putget.h +++ b/lib/erl_interface/src/misc/putget.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/misc/show_msg.c b/lib/erl_interface/src/misc/show_msg.c index 33b09643ca..935a9a3287 100644 --- a/lib/erl_interface/src/misc/show_msg.c +++ b/lib/erl_interface/src/misc/show_msg.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * Copyright Ericsson AB 1998-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/src/prog/ei_fake_prog.c b/lib/erl_interface/src/prog/ei_fake_prog.c index 34101a2851..52a46fc341 100644 --- a/lib/erl_interface/src/prog/ei_fake_prog.c +++ b/lib/erl_interface/src/prog/ei_fake_prog.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2002-2009. All Rights Reserved. + * Copyright Ericsson AB 2002-2013. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in |