diff options
author | Michael Santos <[email protected]> | 2010-10-24 09:09:19 -0400 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2010-10-26 16:00:24 +0200 |
commit | cea06983d15d2c268e4ff6af47edfdadfa189c8b (patch) | |
tree | e5e9f16260b0664ff86df8525c43acf259b6ad7d /lib/erl_interface/src/epmd/epmd_unpublish.c | |
parent | 735dc6c4f7ef51f3ef64ad60382f8a09ca6b9451 (diff) | |
download | otp-cea06983d15d2c268e4ff6af47edfdadfa189c8b.tar.gz otp-cea06983d15d2c268e4ff6af47edfdadfa189c8b.tar.bz2 otp-cea06983d15d2c268e4ff6af47edfdadfa189c8b.zip |
ei: check the length of the node name
Check the length of the node name to prevent an overflow.
Diffstat (limited to 'lib/erl_interface/src/epmd/epmd_unpublish.c')
-rw-r--r-- | lib/erl_interface/src/epmd/epmd_unpublish.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/erl_interface/src/epmd/epmd_unpublish.c b/lib/erl_interface/src/epmd/epmd_unpublish.c index 08662fe1ec..495cbab44c 100644 --- a/lib/erl_interface/src/epmd/epmd_unpublish.c +++ b/lib/erl_interface/src/epmd/epmd_unpublish.c @@ -59,6 +59,11 @@ int ei_unpublish_tmo(const char *alive, unsigned ms) int len = 1 + strlen(alive); int fd, res; + if (len > sizeof(buf)-3) { + erl_errno = ERANGE; + return -1; + } + put16be(s,len); put8(s,EI_EPMD_STOP_REQ); strcpy(s, alive); |