X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=net.c;h=88eb20e56eefe69328b9336ce8842b69fe8532d3;hp=bc7d234bfa2ec01619d8bc698dfb2841053b0eca;hb=e5a4d6bb1e2ca7f81bc99b5d543cd5a0e5ffc693;hpb=d6dcce32b8e844b7a2ffeb5ff2e519e89fb7be3f diff --git a/net.c b/net.c index bc7d234b..88eb20e5 100644 --- a/net.c +++ b/net.c @@ -151,7 +151,8 @@ int send_bin_buffer(int fd, const char *buf, size_t len) cf = crypt_data_array[fd].send; if (cf) { void *private = crypt_data_array[fd].private_data; - unsigned char *outbuf = para_malloc(len); + /* RC4 may write more than len to the output buffer */ + unsigned char *outbuf = para_malloc(ROUND_UP(len, 8)); (*cf)(len, (unsigned char *)buf, outbuf, private); ret = sendall(fd, (char *)outbuf, &len); free(outbuf);