From deee48d495510b5e8d2a17c887f7c33046100778 Mon Sep 17 00:00:00 2001
From: Vsevolod Stakhov <vsevolod@highsecure.ru>
Date: Fri, 29 May 2015 11:47:22 +0100
Subject: Avoid double free when extending HTTP message.

---
 src/libutil/http.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libutil/http.c b/src/libutil/http.c
index 5e589afc2..a9b4e1de2 100644
--- a/src/libutil/http.c
+++ b/src/libutil/http.c
@@ -613,6 +613,8 @@ rspamd_http_on_body (http_parser * parser, const gchar *at, size_t length)
 	priv = conn->priv;
 
 	g_string_append_len (priv->msg->body, at, length);
+	/* Append might cause realloc */
+	priv->msg->body_buf.str = priv->msg->body->str;
 
 	if ((conn->opts & RSPAMD_HTTP_BODY_PARTIAL) && !priv->encrypted) {
 		/* Incremental update is basically impossible for encrypted requests */
-- 
cgit v1.2.3