aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 1749cb624..ec435bc83 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -384,6 +384,11 @@ rspamd_dispatcher_write (rspamd_io_dispatcher_t * d, void *data, size_t len, gbo
rspamd_buffer_t *newbuf;
newbuf = memory_pool_alloc (d->pool, sizeof (rspamd_buffer_t));
+ if (len == 0) {
+ /* Assume NULL terminated */
+ len = strlen ((char *)data);
+ }
+
if (!allocated) {
newbuf->data = fstralloc (d->pool, len);