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]

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


The bug is actually in the LC_COLLATE data files, ie. in localedef, not in
libc.  Note: YOU HAVE TO REGENERATE ALL LOCALE DATA FILES.

Andreas.

----------------------------------------------------------------------
1999-04-23  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* locale/programs/ld-collate.c (collate_output): Convert
	undefined_offset to an array index.  Fix computation of other
	endian extra table.

--- libc-2.1/locale/programs/ld-collate.c.~1~	Mon Jan 25 20:15:30 1999
+++ libc-2.1/locale/programs/ld-collate.c	Fri Apr 23 19:17:26 1999
@@ -608,6 +608,8 @@
     size_t idx, cnt;
 
     undefined_offset = obstack_object_size (&non_simple);
+    assert (undefined_offset % sizeof (u_int32_t) == 0);
+    undefined_offset /= sizeof (u_int32_t);
 
     idx = collate->nrules;
     for (cnt = 0; cnt < collate->nrules; ++cnt)
@@ -634,7 +636,7 @@
     table2[cnt] = SWAPU32 (table[cnt]);
 
   for (cnt = 0; cnt < extra_len / sizeof (u_int32_t); ++cnt)
-    extra2[cnt] = SWAPU32 (extra2[cnt]);
+    extra2[cnt] = SWAPU32 (extra[cnt]);
 
   /* We need a simple hashing table to get a collation-element->chars
      mapping.  We again use internal hashing using a secondary hashing

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org


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