From b0709d2649ebd7ad01d6e24851dcdfc2707d09c5 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 19 Oct 2007 19:07:30 +0000 Subject: [PATCH] Fix meta data segfault when receiving a partial command. --- src/meta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.39.5