]> source.dussan.org Git - rspamd.git/commitdiff
Do not output broken emails.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2015 14:34:10 +0000 (15:34 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2015 14:34:10 +0000 (15:34 +0100)
src/libserver/protocol.c

index 99a363166d52f65da31fa8874e338b55e810c5da..32c42013140c4ab6e0ae18c4b75bfcf19208b990 100644 (file)
@@ -709,8 +709,11 @@ emails_protocol_cb (gpointer key, gpointer value, gpointer ud)
        struct rspamd_url *url = value;
        ucl_object_t *obj;
 
-       obj = ucl_object_fromlstring (url->user, url->userlen + url->hostlen + 1);
-       ucl_array_append (cb->top, obj);
+       if (url->userlen > 0 && url->hostlen > 0) {
+               obj = ucl_object_fromlstring (url->user,
+                               url->userlen + url->hostlen + 1);
+               ucl_array_append (cb->top, obj);
+       }
 }
 
 static ucl_object_t *