TagString: use g_strndup() for unterminated string
Fixes buffer overflow bug.
This commit is contained in:
parent
432ce9b1de
commit
c37f7abb79
@ -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] = '?';
|
||||
|
Loading…
Reference in New Issue
Block a user