diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-19 16:45:38 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-19 16:45:38 +0100 |
commit | 3da37eb2717f5bcc167d158c3fc2433ab2b3d179 (patch) | |
tree | 2f75b2a91ffa14b1258117aaa371d7e1925ab5ef /src | |
parent | 82bb01e1f894af9777625bfbfb9049e5083e0e56 (diff) | |
download | rspamd-3da37eb2717f5bcc167d158c3fc2433ab2b3d179.tar.gz rspamd-3da37eb2717f5bcc167d158c3fc2433ab2b3d179.zip |
[Fix] Avoid double frees in HEAD requests
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/http.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c index dedf8572d..cbafec678 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -703,6 +703,10 @@ rspamd_http_on_body (http_parser * parser, const gchar *at, size_t length) } } + if (conn->finished) { + return 0; + } + if (conn->max_size > 0 && msg->body_buf.len + length > conn->max_size) { /* Body length overflow */ @@ -756,6 +760,10 @@ rspamd_http_on_body_decrypted (http_parser * parser, const gchar *at, size_t len priv->header = NULL; } + if (conn->finished) { + return 0; + } + if (priv->msg->body_buf.len == 0) { priv->msg->body_buf.begin = at; @@ -896,6 +904,10 @@ rspamd_http_on_message_complete (http_parser * parser) int ret = 0; enum rspamd_cryptobox_mode mode; + if (conn->finished) { + return 0; + } + priv = conn->priv; if ((conn->opts & RSPAMD_HTTP_BODY_PARTIAL) == 0 && IS_CONN_ENCRYPTED (priv)) { |