aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tag/TagString.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tag/TagString.cxx b/src/tag/TagString.cxx
index 3e8d8c1b0..9ab095249 100644
--- a/src/tag/TagString.cxx
+++ b/src/tag/TagString.cxx
@@ -33,7 +33,7 @@ patch_utf8(const char *src, size_t length, const gchar *end)
{
/* duplicate the string, and replace invalid bytes in that
buffer */
- char *dest = g_strdup(src);
+ char *dest = g_strndup(src, length);
do {
dest[end - src] = '?';