svn commit: trunk/uClibc/extra/locale

vapier at uclibc.org vapier at uclibc.org
Mon Jun 26 20:20:14 UTC 2006


Author: vapier
Date: 2006-06-26 13:20:11 -0700 (Mon, 26 Jun 2006)
New Revision: 15516

Log:
Michael Tro?\195?\159 writes:
gen_wctype segfaults on my system when optimized with -O2. It does work 
without optimization, even -O1 does not cause the segfault.  Problem is in 
newopt, at gen_wctype.c:865:
	memcpy(tbl->ti + i * blocksize, ti[uniqblock[i]], blocksize);

The segfault is caused by the uninitialized variable uniqblock when
newopt is called recursively.  The attached patch fixes this.


Modified:
   trunk/uClibc/extra/locale/gen_wctype.c


Changeset:
Modified: trunk/uClibc/extra/locale/gen_wctype.c
===================================================================
--- trunk/uClibc/extra/locale/gen_wctype.c	2006-06-26 14:11:33 UTC (rev 15515)
+++ trunk/uClibc/extra/locale/gen_wctype.c	2006-06-26 20:20:11 UTC (rev 15516)
@@ -785,6 +785,8 @@
 	unsigned char uit[RANGE+1];
 	int shift2;
 
+	memset(uniqblock, 0x00, sizeof(uniqblock));
+
 	ii_save = NULL;
 	blocksize = 1 << shift;
 	numblocks = usize >> shift;




More information about the uClibc-cvs mailing list