From 7cb8fa26cfdcb3d34f8be2b86c48ffc6d7b9d84a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 11 May 2010 09:00:29 +0200 Subject: [PATCH] RC4: Allocate 8 extra bytes for send buffer. valgrind on Mac OS complains. Apparently openssl writes some bytes more than the length of the output buffer. --- crypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypt.c b/crypt.c index b977a07a..b6a54604 100644 --- a/crypt.c +++ b/crypt.c @@ -220,7 +220,7 @@ int rc4_send_bin_buffer(struct rc4_context *rc4c, const char *buf, size_t len) unsigned char *tmp; assert(len); - tmp = para_malloc(len); + tmp = para_malloc(len + 8); RC4(&rc4c->send_key, len, (const unsigned char *)buf, tmp); ret = write_all(rc4c->fd, (char *)tmp, &len); free(tmp); -- 2.39.5