summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-06-26 20:20:11 +0000
committerMike Frysinger <vapier@gentoo.org>2006-06-26 20:20:11 +0000
commit6550b9fbe810a91765a40d8a684ebf20c183c628 (patch)
tree286eea86e6c93669a5cc292a26d93e6fda3c377f /extra
parentb09c39cd76881c0fe1336b34594ef80f1119f54a (diff)
Michael Troß 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.
Diffstat (limited to 'extra')
-rw-r--r--extra/locale/gen_wctype.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/extra/locale/gen_wctype.c b/extra/locale/gen_wctype.c
index c29c1b952..6db285e3a 100644
--- a/extra/locale/gen_wctype.c
+++ b/extra/locale/gen_wctype.c
@@ -785,6 +785,8 @@ size_t newopt(unsigned char *ut, size_t usize, int shift, table_data *tbl)
unsigned char uit[RANGE+1];
int shift2;
+ memset(uniqblock, 0x00, sizeof(uniqblock));
+
ii_save = NULL;
blocksize = 1 << shift;
numblocks = usize >> shift;