]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Avoid letting miltertest crash rspamd_proxy
authorAndrew Lewis <nerf@judo.za.org>
Tue, 30 Jan 2018 12:28:17 +0000 (14:28 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 2 Feb 2018 07:57:30 +0000 (09:57 +0200)
src/libserver/milter.c

index d83bf23088a16e141a36e1671abf20146a522542..3081947b9edbc210ac6d524b2ff73a2a3d9813b0 100644 (file)
@@ -529,6 +529,10 @@ rspamd_milter_process_command (struct rspamd_milter_session *session,
                break;
        case RSPAMD_MILTER_CMD_HEADER:
                msg_debug_milter ("got header command");
+               if (!session->message) {
+                       session->message = rspamd_fstring_sized_new (
+                                       RSPAMD_MILTER_MESSAGE_CHUNK);
+               }
                zero = memchr (pos, '\0', cmdlen);
 
                if (zero == NULL) {