The following patch fixes an off-by-one error in the 21.4.21 mule-ccl.c file,
which causes corruption and crashes when a ccl program accesses the
last official 2D charset, namely chinese-cns11643-2.
(This bug has been annoying me for a long time, since I tried to have
cns high in the unicode translation precedence list, but couldn't,
since I got crashes, which I wrongly assumed to be due to bugs in the
code conversion ccl programs. Quite by chance, while trying to track
a quite different problem, I noticed this error; fixing it resolves my
problems with cns.)
This patch should also be applied to the 21.5 source, where the
bug is still present.
--- src/mule-ccl.c-orig 2008-10-25 16:36:30.000000000 +0100
+++ src/mule-ccl.c 2008-10-25 16:19:31.000000000 +0100
@@ -1380,7 +1380,7 @@
if (XCHARSET_DIMENSION (CHARSET_BY_LEADING_BYTE (i)) == 1)
i = (((i - FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7)
| (reg[rrr] & 0x7F));
- else if (i < MAX_LEADING_BYTE_OFFICIAL_2)
+ else if (i <= MAX_LEADING_BYTE_OFFICIAL_2)
i = ((i - FIELD1_TO_OFFICIAL_LEADING_BYTE) << 14)
| reg[rrr];
else
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches