From 221287120dcfe87d695208604623b6b0c679240f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 29 May 2015 11:47:22 +0100 Subject: [PATCH] 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 */ -- 2.39.5