]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add guards for header regexps
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 May 2016 12:05:23 +0000 (13:05 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 May 2016 12:05:23 +0000 (13:05 +0100)
src/libserver/re_cache.c

index 77f97c97f716f77de9b9960bc22323db88a808b1..332486cdd3f0a08d45b9fcfbca7c69b7e90e23ff 100644 (file)
@@ -746,7 +746,7 @@ rspamd_re_cache_exec_re (struct rspamd_task *task,
                                re_class->type_data,
                                is_strong);
 
-               if (headerlist) {
+               if (headerlist && headerlist->len > 0) {
                        scvec = g_malloc (sizeof (*scvec) * headerlist->len);
                        lenvec = g_malloc (sizeof (*lenvec) * headerlist->len);
 
@@ -795,7 +795,7 @@ rspamd_re_cache_exec_re (struct rspamd_task *task,
                                re_class->type_data,
                                is_strong);
 
-               if (headerlist) {
+               if (headerlist && headerlist->len > 0) {
                        scvec = g_malloc (sizeof (*scvec) * headerlist->len);
                        lenvec = g_malloc (sizeof (*lenvec) * headerlist->len);