diff --git a/libgnucash/backend/xml/sixtp-to-dom-parser.cpp b/libgnucash/backend/xml/sixtp-to-dom-parser.cpp index e6ba430393..9aba0801a3 100644 --- a/libgnucash/backend/xml/sixtp-to-dom-parser.cpp +++ b/libgnucash/backend/xml/sixtp-to-dom-parser.cpp @@ -95,7 +95,7 @@ static gboolean dom_chars_handler ( { if (length > 0) { - gchar* newtext = g_strdup (text); + gchar* newtext = g_strndup (text,length); xmlNodeAddContentLen ((xmlNodePtr)parent_data, checked_char_cast (newtext), length); g_free (newtext);