OCaml 4.14.0 rebuild: ocaml-ctypes 0.20.1-1
[arch-packages.git] / libid3tag / trunk / 10_utf16.diff
bloba3218d26d8ba1aa1351cc71e3b445cf082bf2ee7
1 #! /bin/sh -e
2 ## 10_utf16.dpatch by <kurt@roeckx.be>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Handle bogus UTF16 sequences that have a length that is not
6 ## DP: an even number of 8 bit characters.
8 if [ $# -lt 1 ]; then
9 echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
10 exit 1
13 [ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
14 patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
16 case "$1" in
17 -patch) patch -p1 ${patch_opts} < $0;;
18 -unpatch) patch -R -p1 ${patch_opts} < $0;;
20 echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
21 exit 1;;
22 esac
24 exit 0
26 @DPATCH@
27 diff -urNad libid3tag-0.15.1b/utf16.c /tmp/dpep.tKvO7a/libid3tag-0.15.1b/utf16.c
28 --- libid3tag-0.15.1b/utf16.c 2006-01-13 15:26:29.000000000 +0100
29 +++ /tmp/dpep.tKvO7a/libid3tag-0.15.1b/utf16.c 2006-01-13 15:27:19.000000000 +0100
30 @@ -282,5 +282,18 @@
32 free(utf16);
34 + if (end == *ptr && length % 2 != 0)
35 + {
36 + /* We were called with a bogus length. It should always
37 + * be an even number. We can deal with this in a few ways:
38 + * - Always give an error.
39 + * - Try and parse as much as we can and
40 + * - return an error if we're called again when we
41 + * already tried to parse everything we can.
42 + * - tell that we parsed it, which is what we do here.
43 + */
44 + (*ptr)++;
45 + }
47 return ucs4;