From: Ulrich Drepper Date: Thu, 24 Feb 2000 05:47:54 +0000 (+0000) Subject: (allocate_arrays): Make sure the end of width table is 4-byte aligned. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31df69753f1b8a31163c338ae5d4eb908067aa51;p=thirdparty%2Fglibc.git (allocate_arrays): Make sure the end of width table is 4-byte aligned. --- diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c index b36d313ec3f..2d63c2c31eb 100644 --- a/locale/programs/ld-ctype.c +++ b/locale/programs/ld-ctype.c @@ -1433,6 +1433,7 @@ allocate_arrays (struct locale_ctype_t *ctype, struct charset_t *charset) value for TABSIZE * N, where TABSIZE >= 256. */ size_t min_total = UINT_MAX; size_t act_size = 256; + size_t width_table_size; if (!be_quiet) fputs (_("\ @@ -1636,8 +1637,9 @@ Computing table size for character classes might take a while..."), /* Array for width information. Because the expected width are very small we use only one single byte. This save space and we need not provide the information twice with both endianesses. */ - ctype->width = (unsigned char *) xmalloc (ctype->plane_size - * ctype->plane_cnt); + width_table_size = (ctype->plane_size * ctype->plane_cnt + 3) & ~3ul; + ctype->width = (unsigned char *) xmalloc (width_table_size); + /* Initialize with default width value. */ memset (ctype->width, charset->width_default, ctype->plane_size * ctype->plane_cnt);