diff options
author | gilles <gilles@poolp.org> | 2016-06-24 18:14:41 +0200 |
---|---|---|
committer | gilles <gilles@poolp.org> | 2016-06-24 18:14:41 +0200 |
commit | 65235657f18dfaaa02652a17131b2f112a738883 (patch) | |
tree | 05ced917f06df4fcff8ade7104729c1f0db0dca6 | |
parent | plug leak (diff) | |
download | OpenSMTPD-extras-65235657f18dfaaa02652a17131b2f112a738883.tar.xz OpenSMTPD-extras-65235657f18dfaaa02652a17131b2f112a738883.zip |
setup iobuf / io in transaction allocator, otherwise if a reset happens
before DATA, we'll release an uninitialized state and abort
-rw-r--r-- | extras/filters/filter-rspamd/rspamd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/extras/filters/filter-rspamd/rspamd.c b/extras/filters/filter-rspamd/rspamd.c index 53a1e5d..23901d7 100644 --- a/extras/filters/filter-rspamd/rspamd.c +++ b/extras/filters/filter-rspamd/rspamd.c @@ -61,6 +61,9 @@ transaction_allocator(uint64_t id) tx = xcalloc(1, sizeof *tx, "transaction_allocator"); tx->id = id; + iobuf_xinit(&tx->iobuf, LINE_MAX, LINE_MAX, "on_eom"); + io_init(&tx->io, -1, tx, rspamd_io, &tx->iobuf); + return tx; } @@ -128,8 +131,6 @@ rspamd_resolve(const char *h, const char *p) int rspamd_connect(struct transaction *tx) { - iobuf_xinit(&tx->iobuf, LINE_MAX, LINE_MAX, "on_eom"); - io_init(&tx->io, -1, tx, rspamd_io, &tx->iobuf); if (io_connect(&tx->io, (struct sockaddr *)&ss, NULL) == -1) return 0; return 1; |