X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=net.c;h=3dcd9c0be5884f59293d012c3e117ea61b83a282;hp=c5f33c822164195615d7f8f318f22a3f1d43a79f;hb=a3b43ea4ccc39b56ec4de003f83836b75905afe2;hpb=8211954fc3390c0fa19cca788b03336a37aa9dc0 diff --git a/net.c b/net.c index c5f33c82..3dcd9c0b 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);