From: Vsevolod Stakhov Date: Fri, 29 May 2015 10:47:22 +0000 (+0100) Subject: Avoid double free when extending HTTP message. X-Git-Tag: 1.0.0~582 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=deee48d495510b5e8d2a17c887f7c33046100778;p=rspamd.git Avoid double free when extending HTTP message. --- 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 */