Message ID | 4DA4E440.7090008@redhat.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
diff --git a/util/scan/scan.c b/util/scan/scan.c --- a/util/scan/scan.c +++ b/util/scan/scan.c @@ -884,7 +884,7 @@ static void descriptorcpy(char **dest, c * Destination length should be bigger. As the worse case seems to * use 3 chars for one code, use it for destlen */ - destlen = len * 3; + destlen = len * 4; *dest = malloc(destlen + 1); /* Remove special chars */
As Winfried <handygewinnspiel@gmx.de> pointed, me UTF-8 can have up to 32 bits. Also, someone might want to convert data to UCS-4, So, the buffer need to have 4 bytes per char, to be safe. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html