[erlang-patches] [PATCH] ei: prevent overflow in ei_connect_init/ei_xconnect

Björn Gustavsson <>
Mon Aug 23 16:03:48 CEST 2010


On Sun, Aug 22, 2010 at 4:15 AM, Michael Santos
<> wrote:
> Check the length of the buffer before copying.
>
> ei_cnode ec;
> struct in_addr addr;
> char *node = (char *)calloc(5001, 1);
> (void)memset(node, 'x', 5000);
>
> ei_connect_init(&ec, node, "", 0);
>
> addr.s_addr = inet_addr("192.168.1.1");
> ei_xconnect(&ec, &addr, node);
> ---
>  lib/erl_interface/src/connect/ei_connect.c |    8 ++++++--
>  lib/erl_interface/src/epmd/epmd_port.c     |   12 ++++++++++++
>  2 files changed, 18 insertions(+), 2 deletions(-)
>

Thanks! Will include in pu.

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB


More information about the erlang-patches mailing list