This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Crash (and crude workaround) for glibc2.x wcsxfrm()



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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]