blob: 1466ebdf7191a37669bfadc388fd8e5dd09c0152 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
--- libid3tag-0.15.1b.orig/utf16.c 2004-01-23 10:41:32.000000000 +0100
+++ libid3tag-0.15.1b/utf16.c 2013-10-16 12:34:27.000000000 +0200
@@ -282,5 +282,18 @@ id3_ucs4_t *id3_utf16_deserialize(id3_by
free(utf16);
+ if (end == *ptr && length % 2 != 0)
+ {
+ /* We were called with a bogus length. It should always
+ * be an even number. We can deal with this in a few ways:
+ * - Always give an error.
+ * - Try and parse as much as we can and
+ * - return an error if we're called again when we
+ * already tried to parse everything we can.
+ * - tell that we parsed it, which is what we do here.
+ */
+ (*ptr)++;
+ }
+
return ucs4;
}
|