Patch to fix problem reported by Yu Shao with applications crashing when using zh_CN.UTF8 locale. Patch credit to (David Dawes, Yu Shao) whom are credited in the XFree86 changelog, etc. Bugs this fixes: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=119032 http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=368 http://bugs.xfree86.org/show_bug.cgi?id=991 Date: Thu, 25 Mar 2004 18:06:46 -0800 (PST) From: David Dawes To: cvs-commit@XFree86.Org X-BeenThere: cvs-commit@XFree86.Org Subject: CVS Update: xc (branch: trunk) CVSROOT: /home/x-cvs Module name: xc Changes by: dawes@public.xfree86.org. 04/03/25 18:06:46 Log message: 39. Fix a crash that can happen with apps using the zh_CN.UTF-8 locale (Bugzilla #991, Yu Shao). Modified files: xc/lib/X11/: lcUTF8.c xc/programs/Xserver/hw/xfree86/: CHANGELOG Revision Changes Path 1.17 +6 -2 xc/lib/X11/lcUTF8.c 3.3194 +3 -1 xc/programs/Xserver/hw/xfree86/CHANGELOG Index: xc/lib/X11/lcUTF8.c diff -u xc/lib/X11/lcUTF8.c:1.16 xc/lib/X11/lcUTF8.c:1.17 --- xc/lib/X11/lcUTF8.c:1.16 Mon Nov 17 17:20:12 2003 +++ xc/lib/X11/lcUTF8.c Thu Mar 25 21:06:45 2004 @@ -1750,7 +1750,11 @@ } while (count-- > 0) { XlcCharSet charset = _XlcGetCharSet(*value++); - const char *name = charset->encoding_name; + const char *name; + + if (!charset) + continue; + name = charset->encoding_name; /* If it wasn't already encountered... */ for (k = num - 1; k >= 0; k--) if (!strcmp(preferred[k]->name, name))