From: Guus Sliepen Date: Fri, 19 Oct 2007 19:07:30 +0000 (+0000) Subject: Fix meta data segfault when receiving a partial command. X-Git-Tag: release-1.1pre1~145 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=b0709d2649ebd7ad01d6e24851dcdfc2707d09c5;p=tinc Fix meta data segfault when receiving a partial command. --- diff --git a/src/meta.c b/src/meta.c index 2791ea19..141a1a1d 100644 --- a/src/meta.c +++ b/src/meta.c @@ -106,9 +106,9 @@ bool receive_meta(connection_t *c) { bufp = endp; } else { size_t outlen = inlen; - evbuffer_expand(c->buffer->input, inlen); + evbuffer_expand(c->buffer->input, c->buffer->input->off + inlen); - if(!cipher_decrypt(&c->incipher, bufp, inlen, c->buffer->input->buffer, &outlen, false) || inlen != outlen) { + if(!cipher_decrypt(&c->incipher, bufp, inlen, c->buffer->input->buffer + c->buffer->input->off, &outlen, false) || inlen != outlen) { logger(LOG_ERR, _("Error while decrypting metadata from %s (%s)"), c->name, c->hostname); return false; }