aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--storage_xml.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/storage_xml.c b/storage_xml.c
index 2585b475..52240a36 100644
--- a/storage_xml.c
+++ b/storage_xml.c
@@ -226,11 +226,15 @@ static void xml_end_element( GMarkupParseContext *ctx, const gchar *element_name
}
}
-static void xml_text( GMarkupParseContext *ctx, const gchar *text, gsize text_len, gpointer data, GError **error )
+static void xml_text( GMarkupParseContext *ctx, const gchar *text_orig, gsize text_len, gpointer data, GError **error )
{
+ char text[text_len+1];
struct xml_parsedata *xd = data;
irc_t *irc = xd->irc;
+ strncpy( text, text_orig, text_len );
+ text[text_len] = 0;
+
if( xd->pass_st < XML_PASS_OK )
{
/* Let's not parse anything else if we only have to check