aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/decode/decode_port.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/erl_interface/src/decode/decode_port.c')
-rw-r--r--lib/erl_interface/src/decode/decode_port.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/erl_interface/src/decode/decode_port.c b/lib/erl_interface/src/decode/decode_port.c
index 7fb7d8d414..296ebae024 100644
--- a/lib/erl_interface/src/decode/decode_port.c
+++ b/lib/erl_interface/src/decode/decode_port.c
@@ -34,6 +34,8 @@ int ei_decode_port(const char *buf, int *index, erlang_port *p)
len = get16be(s);
+ if (len > MAXATOMLEN) return -1;
+
if (p) {
memmove(p->node, s, len);
p->node[len] = (char)0;