aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-10-26 13:29:53 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-10-26 13:29:53 +0100
commit033e0961e686f6ec9dc4a5cef9f9cfe3fa69a207 (patch)
treedfb6ba7f13089dc4ca6db9955601bb5b706401f6 /src
parentfa09e693be45f06c8d3d309459b3e37620296641 (diff)
downloadrspamd-033e0961e686f6ec9dc4a5cef9f9cfe3fa69a207.tar.gz
rspamd-033e0961e686f6ec9dc4a5cef9f9cfe3fa69a207.zip
Skip empty text values.
Diffstat (limited to 'src')
-rw-r--r--src/cfg_xml.c9
1 files changed, 9 insertions, 0 deletions
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);