--- libaitio/src/sock.c 2013/11/22 10:19:50 1.4.4.12 +++ libaitio/src/sock.c 2013/11/22 10:23:19 1.4.4.13 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: sock.c,v 1.4.4.12 2013/11/22 10:19:50 misho Exp $ +* $Id: sock.c,v 1.4.4.13 2013/11/22 10:23:19 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -174,6 +174,7 @@ io_rxNet(sched_task_t *task) sockaddr_t sa; socklen_t salen = sizeof sa.ss; + memset(AIT_GET_BUF(&cli->cli_buf[0]), 0, AIT_LEN(&cli->cli_buf[0])); if (s->sock_type == SOCK_STREAM) rlen = recv(TASK_FD(task), AIT_GET_BUF(&cli->cli_buf[0]), AIT_LEN(&cli->cli_buf[0]), 0); @@ -200,6 +201,7 @@ io_rxPty(sched_task_t *task) int rlen; sock_cli_t *cli = TASK_ARG(task); + memset(AIT_GET_BUF(&cli->cli_buf[1]), 0, AIT_LEN(&cli->cli_buf[1])); rlen = read(TASK_FD(task), AIT_GET_BUF(&cli->cli_buf[1]), AIT_LEN(&cli->cli_buf[1])); if (rlen < 1) schedEvent(TASK_ROOT(task), io_closeClient, cli, 0,