TagString: use strndup() for unterminated string
Fixes buffer overflow bug.
This commit is contained in:
parent
f445b0178a
commit
6520589a37
@ -39,7 +39,7 @@ patch_utf8(const char *src, size_t length, const gchar *end)
|
||||
{
|
||||
/* duplicate the string, and replace invalid bytes in that
|
||||
buffer */
|
||||
char *dest = xstrdup(src);
|
||||
char *dest = xstrndup(src, length);
|
||||
|
||||
do {
|
||||
dest[end - src] = '?';
|
||||
|
Loading…
Reference in New Issue
Block a user