]> source.dussan.org Git - rspamd.git/commitdiff
Avoid double free when extending HTTP message.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 May 2015 10:47:22 +0000 (11:47 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 May 2015 11:45:13 +0000 (12:45 +0100)
src/libutil/http.c

index 5e589afc2923e156c7e020416df8a13c76aa23d7..a9b4e1de2d48d9e81fb86aa573faea21e40ee968 100644 (file)
@@ -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 */