Crash (and crude workaround) for glibc2.x wcsxfrm()
neideck@qkal.sap-ag.de
neideck@qkal.sap-ag.de
Wed Apr 21 07:52:00 GMT 1999
Feeding wchar_t strings with characters outside the range 0-255 into
the wcsxfrm() function when under anu of the 8-bit locales (such as de_DE)
leads to a crash. This works on other operating systems such as HP/UX and
Digital Unix (and basically these characters are ignored).
In order to at least suppress the crashes, I made the following crude fix,
which avoids feeding anything outside the safe range,
but probably something better is required (undoubtedly when double-byte
locales become available).
*** glibc-2.1/locale/weight.h.old Wed Apr 21 11:19:03 1999
--- glibc-2.1/locale/weight.h Wed Apr 21 11:12:10 1999
***************
*** 83,88 ****
--- 83,91 ----
unsigned int ch = *((USTRING_TYPE *) (*str))++;
size_t slot;
+ if (ch > 255) {
+ ch = ch & 255;
+ }
if (sizeof (STRING_TYPE) == 1)
slot = ch * (collate_nrules + 1);
else
Burkhard Neidecker-Lutz
CEC Karlsruhe , SAP AG, neideck@qkal.sap-ag.de
More information about the Libc-alpha
mailing list