From 033e0961e686f6ec9dc4a5cef9f9cfe3fa69a207 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 26 Oct 2013 13:29:53 +0100 Subject: [PATCH] Skip empty text values. --- src/cfg_xml.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cfg_xml.c b/src/cfg_xml.c index 2757fded2..f0ed5309d 100644 --- a/src/cfg_xml.c +++ b/src/cfg_xml.c @@ -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); -- 2.39.5