]> source.dussan.org Git - rspamd.git/commitdiff
Skip empty text values.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 26 Oct 2013 12:29:53 +0000 (13:29 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 26 Oct 2013 12:29:53 +0000 (13:29 +0100)
src/cfg_xml.c

index 2757fded2677ec03005608fdcc9ae2ddc76f2d34..f0ed5309dd7f4199a7dc89685bc259ced61cb4b1 100644 (file)
@@ -1270,6 +1270,15 @@ rspamd_xml_text (GMarkupParseContext *context, const gchar *text, gsize text_len
        struct rspamd_xml_userdata *ud = user_data;
        ucl_object_t *top;
        
+       while (text_len > 0 && g_ascii_isspace (*text)) {
+               text_len --;
+               text ++;
+       }
+
+       if (text_len == 0) {
+               return;
+       }
+
        top = ud->parent_pointer[ud->nested - 1];
        ucl_object_insert_key (top, ucl_object_fromstring_common (text, text_len, UCL_STRING_PARSE),
                        ud->section_name[ud->nested], 0, true);