aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/epmd
diff options
context:
space:
mode:
Diffstat (limited to 'lib/erl_interface/src/epmd')
-rw-r--r--lib/erl_interface/src/epmd/epmd_port.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/erl_interface/src/epmd/epmd_port.c b/lib/erl_interface/src/epmd/epmd_port.c
index 3dd3da7aae..698c75c217 100644
--- a/lib/erl_interface/src/epmd/epmd_port.c
+++ b/lib/erl_interface/src/epmd/epmd_port.c
@@ -106,6 +106,12 @@ static int ei_epmd_r4_port (struct in_addr *addr, const char *alive,
#if defined(VXWORKS)
char ntoabuf[32];
#endif
+
+ if (len > sizeof(buf) - 3)
+ {
+ erl_errno = ERANGE;
+ return -1;
+ }
put16be(s,len);
put8(s,EI_EPMD_PORT2_REQ);